summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-02-12 20:57:47 +0000
committerFedja Beader <fedja@protonmail.ch>2025-02-12 20:57:47 +0000
commit530545589cdaf6d1664438e885d0b4e538684d9b (patch)
tree4f7da5e436dfdf1c8cf12423eca712f0325f8f5f
parent5a79d993810032a9b628c13f8192f3a1ac8ba830 (diff)
downloadmanaplus-530545589cdaf6d1664438e885d0b4e538684d9b.tar.gz
manaplus-530545589cdaf6d1664438e885d0b4e538684d9b.tar.bz2
manaplus-530545589cdaf6d1664438e885d0b4e538684d9b.tar.xz
manaplus-530545589cdaf6d1664438e885d0b4e538684d9b.zip
Fix erroneous call in find that resulted in cpplint processing only *.cc files
https://git.themanaworld.org/mana/plus/-/jobs/183682#L81 the ORs were not groupped together in the find call, resulting in only *.cc files being processed. > Total errors found: 3463 Well, this will take a while to fix :disappointed: . Squashed with: * Trim unnecessary excludes, for there is no matching error to exclude. Fine-tune the remaining ones. * The grep below wasn't working as find exited nonzero and code that was supposed to handle that wasn't working as well as expected **** mana/plus!126
-rwxr-xr-xtools/ci/jobs/cpplint.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/ci/jobs/cpplint.sh b/tools/ci/jobs/cpplint.sh
index c8e709fbe..d9ccf92c8 100755
--- a/tools/ci/jobs/cpplint.sh
+++ b/tools/ci/jobs/cpplint.sh
@@ -47,20 +47,24 @@ args+=("--filter=\
-build/c++tr1"\
)
+# Cannot find a good way to handle execution errors
+# (such cpplint.py demanding a version of Python that does not exist)
+# So use || true here and assume any other problems will be exposed
+# by the grep below.
find src \
-type f \
- -name "*.cpp" -o -name "*.hpp" -o -name "*.h" -o -name "*.cc" \
- -exec ./cpplint.py "${args[@]}" {} \+ 2>"$ERRFILE_UNFILTERED" \
- || { cat "$ERRFILE_UNFILTERED"; exit 1; }
+ \( -name "*.cc" \
+ -o -name "*.cpp"\
+ -o -name "*.h" \
+ -o -name "*.hpp" \
+ \) -exec ./cpplint.py --verbose=5 "${args[@]}" {} \+ 2>"$ERRFILE_UNFILTERED" \
+ || true
# If grep does not find any messages, it exits non-zero. Therefore, use ||true
-grep ": " "$ERRFILE_UNFILTERED" \
- | grep -v -e "src/debug/" \
- -e "unittests/doctest.h" \
- -e "unittests/catch.hpp" \
- -e "debug/fast_mutex" \
- -e "sdl2gfx/SDL2" \
- >${ERRFILE} || true
+grep -v -e "^src/debug/nvwa/debug_new.cpp" \
+ -e "^src/unittests/doctest.h" \
+ -e "^src/unittests/catch.hpp" \
+ < "$ERRFILE_UNFILTERED" > "$ERRFILE" || true
run_check_warnings