Browse Source

astyle: restore backwards compatibility with old pre-commit hook

I removed the filtering logic from the shell script in #18482 because
the new pre-commit hook already takes care of it.

The problem is if you don't update the .git/hooks/pre-commit file and
use the new shell script there's no filtering
of files done and it checks all files for every file.

This commit restores backwards compatibility because it does not hurt
until I have an automatic way to update the pre-commit hook file.
master
Matthias Grob 3 years ago
parent
commit
3d50adc5fe
  1. 8
      Tools/astyle/files_to_check_code_style.sh

8
Tools/astyle/files_to_check_code_style.sh

@ -1,6 +1,12 @@ @@ -1,6 +1,12 @@
#!/usr/bin/env bash
set -eu
PATTERN="-e ."
if [ $# -gt 0 ]; then
PATTERN="$1"
fi
exec find boards msg src platforms test \
-path msg/templates/urtps -prune -o \
-path platforms/nuttx/NuttX -prune -o \
@ -21,4 +27,4 @@ exec find boards msg src platforms test \ @@ -21,4 +27,4 @@ exec find boards msg src platforms test \
-path src/lib/crypto/monocypher -prune -o \
-path src/lib/crypto/libtomcrypt -prune -o \
-path src/lib/crypto/libtommath -prune -o \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \)
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN

Loading…
Cancel
Save