mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
fix find in "files_to_check_code_style.sh" (#23269)
* refactor: not necessary "if [ -f "$FILE" ]" * fix: exclude directories --------- Co-authored-by: Isidro Arias <isidro.arias@wslw.es>
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
FILE=$1
|
FILE=$1
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|
||||||
if [ -f "$FILE" ]; then
|
|
||||||
CHECK_FAILED=$(${DIR}/fix_code_style.sh --dry-run --formatted $FILE)
|
CHECK_FAILED=$(${DIR}/fix_code_style.sh --dry-run --formatted $FILE)
|
||||||
if [ -n "$CHECK_FAILED" ]; then
|
if [ -n "$CHECK_FAILED" ]; then
|
||||||
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
|
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
|
||||||
@@ -21,4 +20,3 @@ if [ -f "$FILE" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ exec find boards msg src platforms test \
|
|||||||
-path src/lib/cdrstream/rosidl -prune -o \
|
-path src/lib/cdrstream/rosidl -prune -o \
|
||||||
-path src/modules/zenoh/zenoh-pico -prune -o \
|
-path src/modules/zenoh/zenoh-pico -prune -o \
|
||||||
-path boards/modalai/voxl2/libfc-sensor-api -prune -o \
|
-path boards/modalai/voxl2/libfc-sensor-api -prune -o \
|
||||||
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
|
\( -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) -print \) | grep $PATTERN
|
||||||
|
|||||||
Reference in New Issue
Block a user