Verified Commit 2458d379 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Improve the run-clang-tidy script

parent 2800e2ba
......@@ -24,7 +24,7 @@ build_clazy_clang_tidy:
- python3 -u $CI_TOOLING/helpers/prepare-dependencies.py --product $PRODUCT --project $PROJECT --branchGroup $BRANCH_GROUP --environment production --platform $PLATFORM --installTo $INSTALL_PREFIX
- python3 -u $CI_TOOLING/helpers/configure-build.py --product $PRODUCT --project $PROJECT --branchGroup $BRANCH_GROUP --platform $PLATFORM --installTo $INSTALL_PREFIX
- python3 -u $CI_TOOLING/helpers/compile-build.py --product $PRODUCT --project $PROJECT --branchGroup $BRANCH_GROUP --platform $PLATFORM --usingInstall $INSTALL_PREFIX
- ./tools/run-clang-tidy.sh $(pwd)/build
- time ./tools/run-clang-tidy.sh $(pwd)/build
variables:
PLATFORM: SUSEQt5.14
BRANCH_GROUP: kf5-qt5
......@@ -16,6 +16,11 @@
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
if [ $# -lt 1 ]; then
>&2 echo "Usage: $0 BUILD_DIR"
exit 1
fi
set -xe
BUILDDIR=$1; shift 1
......@@ -34,12 +39,16 @@ function sanitize_compile_commands
return 0
fi
filter_files=$(cat ${filter_file} | tr '\n' '|' | head -c -1)
filter_files=$(cat ${filter_file} | grep -vE "^#\.*|^$" | tr '\n' '|' | head -c -1)
local cc_bak_file=${cc_file}.bak
mv ${cc_file} ${cc_bak_file}
cat ${cc_bak_file} | jq -r "map(select(.file|test(\"${filter_files}\")|not))" > ${cc_file}
cat ${cc_bak_file} \
| jq -r "map(select(.file|test(\"${filter_files}\")|not))" \
> ${cc_file}
task_count=$(cat ${cc_file} | jq "length")
}
sanitize_compile_commands
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment