diff options
author | Fedja Beader <fedja@protonmail.ch> | 2023-09-09 18:04:51 +0200 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2023-09-09 20:48:24 +0200 |
commit | 358cc51cc72de27ee5b90e27211dac127ec73f39 (patch) | |
tree | 326e6759b6b4b52bdfbd92ad26c16353c57e289d /tools | |
parent | 4bc5f2555f48717fc969d3ba8be6e3b27dc2a829 (diff) | |
download | manaplus-358cc51cc72de27ee5b90e27211dac127ec73f39.tar.gz manaplus-358cc51cc72de27ee5b90e27211dac127ec73f39.tar.bz2 manaplus-358cc51cc72de27ee5b90e27211dac127ec73f39.tar.xz manaplus-358cc51cc72de27ee5b90e27211dac127ec73f39.zip |
Reduce number of find and grep invocations
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/ci/jobs/cpplint.sh | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tools/ci/jobs/cpplint.sh b/tools/ci/jobs/cpplint.sh index 496e51eb5..d327e49d1 100755 --- a/tools/ci/jobs/cpplint.sh +++ b/tools/ci/jobs/cpplint.sh @@ -11,7 +11,9 @@ if [[ ! -x cpplint.py \ chmod +x cpplint.py fi -CHECKER="./cpplint.py --filter=\ +declare -a args + +args+=("--filter=\ -build/include,\ -whitespace/braces,-whitespace/operators,-runtime/references,\ -runtime/threadsafe_fn,-readability/streams,\ @@ -35,20 +37,20 @@ CHECKER="./cpplint.py --filter=\ -readability/casting,\ -readability/inheritance,\ -runtime/string,\ --build/c++tr1" - -find src -type f -name "*.cpp" -exec $CHECKER {} \; 2>${ERRFILE}2 -find src -type f -name "*.hpp" -exec $CHECKER {} \; 2>>${ERRFILE}2 -find src -type f -name "*.h" -exec $CHECKER {} \; 2>>${ERRFILE}2 -find src -type f -name "*.cc" -exec $CHECKER {} \; 2>>${ERRFILE}2 - -grep ": " ${ERRFILE}2 | \ -grep -v "src/debug/" | \ -grep -v "unittests/doctest.h" | \ -grep -v "unittests/catch.hpp" | \ -grep -v "debug/fast_mutex" | \ -grep -v "sdl2gfx/SDL2" \ ->${ERRFILE} +-build/c++tr1"\ +) + +find src \ + -type f \ + -name "*.cpp" -o -name "*.hpp" -o -name "*.h" -o -name "*.cc" \ + -exec ./cpplint.py "${args[@]}" {} \; 2>${ERRFILE}2 + +grep ": " ${ERRFILE}2 | grep -v -e "src/debug/" \ + -e "unittests/doctest.h" \ + -e "unittests/catch.hpp" \ + -e "debug/fast_mutex" \ + -e "sdl2gfx/SDL2" \ + >${ERRFILE} rm ${ERRFILE}2 |