queries:
  - exclude: cpp/fixme-comment
  # this rule produces too many false positives due to our custom specifiers and
  # the use of void pointers in swanctl
  - exclude: cpp/wrong-type-format-argument

extraction:
  cpp:
    prepare:
      packages:
        # for tss2
        - libssl-dev
        - libjson-c-dev
        - libcurl4-openssl-dev
    after_prepare:
      - export DEPS_BUILD_DIR=$LGTM_WORKSPACE/deps
      - mkdir -p $DEPS_BUILD_DIR
      - export DEPS_PREFIX=$DEPS_BUILD_DIR/usr
      - mkdir -p $DEPS_PREFIX
      - export PKG_CONFIG_PATH="$DEPS_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
      - export LD_LIBRARY_PATH="$DEPS_PREFIX/lib:$LD_LIBRARY_PATH"
      - mkdir -p $LGTM_WORKSPACE/bin
      # sudo doesn't work on the build hosts
      - ln -s /usr/bin/nice $LGTM_WORKSPACE/bin/sudo
      # for ldconfig we don't have enough permissions
      - ln -s /bin/true $LGTM_WORKSPACE/bin/ldconfig
      # likewise for apt-get
      - ln -s /bin/echo $LGTM_WORKSPACE/bin/apt-get
      - export PATH=$LGTM_WORKSPACE/bin:$PATH
      - export TEST=all
      - ./scripts/test.sh build-deps
      - rm $LGTM_WORKSPACE/bin/*
    configure:
      command:
        # follows the "all" build in test.sh (without custom-compiled stuff)
        - ./autogen.sh
        - ./configure --enable-all --disable-android-dns --disable-android-log
            --disable-kernel-pfroute --disable-keychain
            --disable-lock-profiler --disable-padlock --disable-fuzzing
            --disable-osx-attr --disable-tkm --disable-uci
            --disable-unwind-backtraces
            --disable-svc --disable-dbghelp-backtraces --disable-socket-win
            --disable-kernel-wfp --disable-kernel-iph --disable-winhttp
            --disable-af-alg --disable-coverage
            --disable-python-eggs-install
            --disable-monolithic --disable-leak-detective
