summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2023-09-09 18:04:51 +0200
committerFedja Beader <fedja@protonmail.ch>2023-09-09 20:48:24 +0200
commit358cc51cc72de27ee5b90e27211dac127ec73f39 (patch)
tree326e6759b6b4b52bdfbd92ad26c16353c57e289d
parent4bc5f2555f48717fc969d3ba8be6e3b27dc2a829 (diff)
downloadplus-358cc51cc72de27ee5b90e27211dac127ec73f39.tar.gz
plus-358cc51cc72de27ee5b90e27211dac127ec73f39.tar.bz2
plus-358cc51cc72de27ee5b90e27211dac127ec73f39.tar.xz
plus-358cc51cc72de27ee5b90e27211dac127ec73f39.zip
Reduce number of find and grep invocations
-rwxr-xr-xtools/ci/jobs/cpplint.sh32
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