From 629c0c1ed4a1ac8b9106bbf1cee4df8383b1ce2a Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Mon, 30 Oct 2023 15:04:58 +0000 Subject: [PATCH] clang-tidy, ci: Move extra-args option to configuration file --- .clang-tidy | 3 +++ utils/tests/gitlab-ci-code-linting.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 924c8086e..bf6a8dd64 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -55,6 +55,9 @@ CheckOptions: - key: readability-simplify-boolean-expr.SimplifyDeMorgan value: false +ExtraArgs: + - -Wno-unknown-warning-option + FormatStyle: "file" HeaderFilterRegex: ".*(ns|NS).*/(contrib|examples|src|scratch|utils)/*/.*h" UseColor: true diff --git a/utils/tests/gitlab-ci-code-linting.yml b/utils/tests/gitlab-ci-code-linting.yml index 968de090d..763df9b20 100644 --- a/utils/tests/gitlab-ci-code-linting.yml +++ b/utils/tests/gitlab-ci-code-linting.yml @@ -63,7 +63,7 @@ clang-tidy-16: - if !([[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]] || (grep -q ".clang-tidy" $FILES_CHANGED)) ; then echo "Running clang-tidy-diff" ; git diff -U0 upstream/$CI_DEFAULT_BRANCH | - clang-tidy-diff-16.py -path cmake-cache/ -p1 -quiet -use-color -extra-arg=-Wno-unknown-warning-option + clang-tidy-diff-16.py -path cmake-cache/ -p1 -quiet -use-color -iregex "(contrib|examples|src|scratch|utils)\/.+\.(cpp|cc|cxx|c|h|hpp)" 1> $CLANG_TIDY_OUTPUT 2> /dev/null ; @@ -72,7 +72,7 @@ clang-tidy-16: # Run full clang-tidy in the following cases: 1) default branch, 2) ".clang-tidy" file changed, 3) clang-tidy-diff had an error - if [[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]] || (grep -q ".clang-tidy" $FILES_CHANGED) || (egrep -q -A 3 "file not found \[clang-diagnostic-error\]" $CLANG_TIDY_OUTPUT) ; then echo "Running full clang-tidy" ; - run-clang-tidy-16 -p cmake-cache/ -quiet -extra-arg=-Wno-unknown-warning-option + run-clang-tidy-16 -p cmake-cache/ -quiet 1> $CLANG_TIDY_OUTPUT 2> /dev/null ; fi