<commit_before>version: '1.0.{build}'

image: ubuntu

matrix:
  fast_finish: true

configuration:
  - Debug
  - Release

environment:
  UPDATE_ALTERNATIVE_PRIORITY: 9999

  matrix:
    - COMPILER: gcc
      COMPILER_CPP: g++
      COMPILER_VERSION: 8

    - COMPILER: clang
      COMPILER_CPP: clang++
      COMPILER_VERSION: 6.0

install:
  # Compilers
  - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  - sudo apt-get update -y
  - sudo apt-get install ${COMPILER}-${COMPILER_VERSION} ${COMPILER_CPP}-${COMPILER_VERSION} -y
  - sudo update-alternatives --install /usr/bin/${COMPILER} ${COMPILER} /usr/bin/${COMPILER}-${COMPILER_VERSION} ${UPDATE_ALTERNATIVE_PRIORITY} --slave /usr/bin/${COMPILER_CPP} ${COMPILER_CPP} /usr/bin/${COMPILER_CPP}-${COMPILER_VERSION}

  # Static analysis
  - sudo apt-get install cppcheck -y
  - sudo apt-get install clang-tidy -y

before_build:
  # Debug logs
  - lsb_release -a
  - ldd --version
  - ld -v
  - ${COMPILER_CPP} -v
  - cppcheck --version
  - env

  # Appveyor limitation
  - git submodule update --init --recursive
  - mkdir build && cd build
  - cmake -DCMAKE_CXX_COMPILER=/usr/bin/${COMPILER_CPP} -DCMAKE_BUILD_TYPE=${CONFIGURATION} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..

build_script:
  - make -j8 VERBOSE=1

after_build:
  # Cannot activate --error-exitcode=1 as there's false positive (16.04)
  - cppcheck --enable=all --inline-suppr --suppress=missingIncludeSystem ../${APPVEYOR_PROJECT_NAME}/
  - if [ "${COMPILER}" = "clang" ]; then
      find ../${APPVEYOR_PROJECT_NAME}/* -name '*.cpp' -not -name 'CMakeCXXCompilerId.cpp' | xargs clang-tidy -p ./ -config ''
    fi

test_script:
  - ctest -V

after_test:
  - if [ "${CONFIGURATION}" = "Release" ]; then
      ./bin/benchmark_${APPVEYOR_PROJECT_NAME};
    fi

# - TODO:
# clang-format
# clean benchmarks
# add benchmark from the presentation
# report cppcheck
# report test
# report benchmark + graph
# lto release (on hold until 18.04 release on appveyor)
<commit_msg>clang-tidy<commit_after>version: '1.0.{build}'

image: ubuntu

matrix:
  fast_finish: true

configuration:
  - Debug
  - Release

environment:
  UPDATE_ALTERNATIVE_PRIORITY: 9999

  matrix:
    - COMPILER: gcc
      COMPILER_CPP: g++
      COMPILER_VERSION: 8

    - COMPILER: clang
      COMPILER_CPP: clang++
      COMPILER_VERSION: 6.0

install:
  # Compilers
  - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  - sudo apt-get update -y
  - sudo apt-get install ${COMPILER}-${COMPILER_VERSION} ${COMPILER_CPP}-${COMPILER_VERSION} -y
  - sudo update-alternatives --install /usr/bin/${COMPILER} ${COMPILER} /usr/bin/${COMPILER}-${COMPILER_VERSION} ${UPDATE_ALTERNATIVE_PRIORITY} --slave /usr/bin/${COMPILER_CPP} ${COMPILER_CPP} /usr/bin/${COMPILER_CPP}-${COMPILER_VERSION}

  # Static analysis
  - sudo apt-get install cppcheck -y
  - if [ "${COMPILER}" = "clang" ]; then
      sudo apt-get install clang-tidy -y
      sudo apt-get install clang-format -y
    fi

before_build:
  # Debug logs
  - lsb_release -a
  - ldd --version
  - ld -v
  - ${COMPILER_CPP} -v
  - cppcheck --version
  - env

  # Appveyor limitation
  - git submodule update --init --recursive
  - mkdir build && cd build
  - cmake -DCMAKE_CXX_COMPILER=/usr/bin/${COMPILER_CPP} -DCMAKE_BUILD_TYPE=${CONFIGURATION} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..

build_script:
  - make -j8 VERBOSE=1

after_build:
  # Cannot activate --error-exitcode=1 as there's false positive (16.04)
  - cppcheck --enable=all --inline-suppr --suppress=missingIncludeSystem ../${APPVEYOR_PROJECT_NAME}/
  - if [ "${COMPILER}" = "clang" ]; then
      find ../${APPVEYOR_PROJECT_NAME}/* -name '*.cpp' -not -name 'CMakeCXXCompilerId.cpp' | xargs clang-tidy -p ./ -config ''
    fi

test_script:
  - ctest -V

after_test:
  - if [ "${CONFIGURATION}" = "Release" ]; then
      ./bin/benchmark_${APPVEYOR_PROJECT_NAME};
    fi

# - TODO:
# clang-format
# clean benchmarks
# add benchmark from the presentation
# report cppcheck
# report test
# report benchmark + graph
# lto release (on hold until 18.04 release on appveyor)

{'fraction_non_alphanumeric': 0.1362740266140956, 'fraction_numerical': 0.009857072449482503, 'mean_word_length': 3.263655462184874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1295378', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1510, 'n_words': 338}