mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-20 17:44:20 +08:00
[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:
co-authored by
supperthomas
parent
01d1bbe40d
commit
b1584e9fa9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user