[CI] Added feature to filter out files to file_check.py that do not require cppcheck (#7499)

Co-authored-by: supperthomas <78900636@qq.com>
This commit is contained in:
dejavudwh
2023-05-16 07:51:16 +08:00
committed by GitHub
co-authored by supperthomas
parent 01d1bbe40d
commit b1584e9fa9
3 changed files with 150 additions and 9 deletions
+3 -9
View File
@@ -1,6 +1,6 @@
name: Static code analysis
on:
on:
pull_request:
branches:
- master
@@ -21,16 +21,10 @@ jobs:
run: |
sudo apt-get update
sudo apt-get -qq install cppcheck
pip install click PyYaml
git remote -v
git fetch origin
cppcheck --version
ls
git branch -a
changed_files=$(git diff --name-only HEAD origin/master | grep -E '\.(c|cpp|cc|cxx)$' || true)
if [ -n "$changed_files" ];then
cppcheck --enable=warning,performance,portability --inline-suppr --error-exitcode=1 --force $changed_files
err=$?
if [ $err -ne 0 ]; then
echo "CPPCHECK REPORT, PLEASE CHECK THE WARNING !!!!!!!!!"
fi
fi
python tools/ci/cpp_check.py check