From 31c03a95da5e3399c050bc15edb697002bcb9178 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 12 Oct 2020 12:08:39 +0800 Subject: [PATCH] CI: Exclude list for sonarqube --- tools/ci/config/build.yml | 5 +++-- tools/ci/sonar_exclude_list.txt | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tools/ci/sonar_exclude_list.txt diff --git a/tools/ci/config/build.yml b/tools/ci/config/build.yml index 88660e5f0b..999f460a31 100644 --- a/tools/ci/config/build.yml +++ b/tools/ci/config/build.yml @@ -449,8 +449,9 @@ build_template_app: # Exclude the submodules, all paths ends with /** # get all submodules configs | get all paths | add /** as suffix | xargs | replace all to - export SUBMODULES=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | sed -e 's|$|/**|' | xargs | sed -e 's/ /,/g') - # Exclude the report dir - - export EXCLUSIONS="$SUBMODULES,$REPORT_DIR/**,docs/_static/**,**/*.png,**/*.jpg" + # get all exclude paths specified in tools/ci/sonar_exclude_list.txt | ignore lines start with # | xargs | replace all to + - export CUSTOM_EXCLUDES=$(cat $CI_PROJECT_DIR/tools/ci/sonar_exclude_list.txt | grep -v '^#' | xargs | sed -e 's/ /,/g') + - export EXCLUSIONS="$SUBMODULES,$CUSTOM_EXCLUDES,$REPORT_DIR/**,docs/_static/**,**/*.png,**/*.jpg" - python $NORMALIZE_CLANGTIDY_PY $CI_PROJECT_DIR/$REPORT_DIR/warnings.txt $CI_PROJECT_DIR/$REPORT_DIR/clang_tidy_report.txt $CI_PROJECT_DIR variables: GIT_DEPTH: 0 diff --git a/tools/ci/sonar_exclude_list.txt b/tools/ci/sonar_exclude_list.txt new file mode 100644 index 0000000000..849bc4c50f --- /dev/null +++ b/tools/ci/sonar_exclude_list.txt @@ -0,0 +1,6 @@ +# exclude list for sonarqube +# Here're some examples: (relative with the idf_path) +# - test/** +# - test/*/*.c +# - test.c +# lines start with # will be ignored