mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
cleanup 'make check_format and exclude directories not ready for formatting
-uORB, sdlog2, vtol_att_control, ekf_att_pos_estimator
This commit is contained in:
@@ -222,9 +222,9 @@ qurtrun:
|
|||||||
tests: generateuorbtopicheaders
|
tests: generateuorbtopicheaders
|
||||||
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) --no-print-directory unittests)
|
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) --no-print-directory unittests)
|
||||||
|
|
||||||
.PHONY: format check_format
|
.PHONY: check_format
|
||||||
check_format:
|
check_format:
|
||||||
$(Q) (./Tools/check_code_style.sh | sort -n)
|
$(Q) (./Tools/check_code_style.sh)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cleanup targets. 'clean' should remove all built products and force
|
# Cleanup targets. 'clean' should remove all built products and force
|
||||||
|
|||||||
+14
-10
@@ -1,16 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eu
|
set -eu
|
||||||
failed=0
|
failed=0
|
||||||
for fn in $(find . -path './src/lib/uavcan' -prune -o \
|
for fn in $(find . -path './Build' -prune -o \
|
||||||
-path './src/lib/mathlib/CMSIS' -prune -o \
|
|
||||||
-path './src/lib/eigen' -prune -o \
|
|
||||||
-path './src/modules/attitude_estimator_ekf/codegen' -prune -o \
|
|
||||||
-path './NuttX' -prune -o \
|
|
||||||
-path './Build' -prune -o \
|
|
||||||
-path './mavlink' -prune -o \
|
-path './mavlink' -prune -o \
|
||||||
-path './unittests/gtest' -prune -o \
|
-path './NuttX' -prune -o \
|
||||||
|
-path './src/lib/eigen' -prune -o \
|
||||||
|
-path './src/lib/mathlib/CMSIS' -prune -o \
|
||||||
|
-path './src/lib/uavcan' -prune -o \
|
||||||
|
-path './src/modules/attitude_estimator_ekf/codegen' -prune -o \
|
||||||
|
-path './src/modules/ekf_att_pos_estimator' -prune -o \
|
||||||
|
-path './src/modules/sdlog2' -prune -o \
|
||||||
|
-path './src/modules/uORB' -prune -o \
|
||||||
|
-path './src/modules/vtol_att_control' -prune -o \
|
||||||
-path './unittests/build' -prune -o \
|
-path './unittests/build' -prune -o \
|
||||||
-name '*.c' -o -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -type f); do
|
-path './unittests/gtest' -prune -o \
|
||||||
|
-name '*.c' -o -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -not -name '*generated*' -type f); do
|
||||||
if [ -f "$fn" ];
|
if [ -f "$fn" ];
|
||||||
then
|
then
|
||||||
./Tools/fix_code_style.sh --quiet < $fn > $fn.pretty
|
./Tools/fix_code_style.sh --quiet < $fn > $fn.pretty
|
||||||
@@ -18,7 +22,7 @@ for fn in $(find . -path './src/lib/uavcan' -prune -o \
|
|||||||
rm -f $fn.pretty
|
rm -f $fn.pretty
|
||||||
if [ $diffsize -ne 0 ]; then
|
if [ $diffsize -ne 0 ]; then
|
||||||
failed=1
|
failed=1
|
||||||
echo $diffsize $fn
|
echo $fn 'bad formatting, please run "./Tools/fix_code_style.sh' $fn'"'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -27,6 +31,6 @@ if [ $failed -eq 0 ]; then
|
|||||||
echo "Format checks passed"
|
echo "Format checks passed"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Format checks failed; please run ./Tools/fix_code_style.sh on each file"
|
echo "Format checks failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user