From c3e2f84273e7f1591f0fff850a9590ec68cf7753 Mon Sep 17 00:00:00 2001 From: Project579 Date: Wed, 13 Jul 2022 00:38:24 +0000 Subject: [PATCH] Fix clang-tidy on CI and introduce .clang-tidy file --- .clang-tidy | 8 ++++++++ .gitlab-ci.yml | 23 ++--------------------- CI/before_script.linux.sh | 2 +- 3 files changed, 11 insertions(+), 22 deletions(-) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..e33d426873 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,8 @@ +--- +Checks: "-*, + boost-*, + portability-*, +" +WarningsAsErrors: '' +HeaderFilterRegex: '' +FormatStyle: none diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03474a7149..58ee618993 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,26 +55,6 @@ variables: paths: - build/install/ -Clang_Tidy: - extends: .Ubuntu_Image - stage: build - rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' - before_script: - - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic clang-tidy clang - script: - - CI/before_script.linux.sh - - cd build - - cmake --build . -- -j $(nproc) openmw esmtool bsatool niftest openmw-wizard openmw-launcher openmw-iniimporter openmw-essimporter - variables: - CC: clang - CXX: clang++ - CI_CLANG_TIDY: 1 - timeout: 8h - artifacts: - paths: [] - expire_in: 1 minute - Coverity: extends: .Ubuntu_Image stage: build @@ -261,12 +241,13 @@ Ubuntu_GCC: Ubuntu_Clang: extends: .Ubuntu before_script: - - CI/install_debian_deps.sh clang openmw-deps openmw-deps-dynamic + - CI/install_debian_deps.sh clang clang-tidy openmw-deps openmw-deps-dynamic cache: key: Ubuntu_Clang.v2 variables: CC: clang CXX: clang++ + CI_CLANG_TIDY: 1 CCACHE_SIZE: 2G # When CCache doesn't exist (e.g. first build on a fork), build takes more than 1h, which is the default for forks. timeout: 2h diff --git a/CI/before_script.linux.sh b/CI/before_script.linux.sh index cae35dff68..9fce76b7e8 100755 --- a/CI/before_script.linux.sh +++ b/CI/before_script.linux.sh @@ -43,7 +43,7 @@ fi if [[ $CI_CLANG_TIDY ]]; then CMAKE_CONF_OPTS+=( - -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-checks=-*,boost-*,clang-analyzer-*,concurrency-*,performance-*,-header-filter=.*,bugprone-*,misc-definitions-in-headers,misc-misplaced-const,misc-redundant-expression,-bugprone-narrowing-conversions" + -DCMAKE_CXX_CLANG_TIDY="clang-tidy;--warnings-as-errors=*" ) fi