mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 18:33:34 +08:00
add make format (check_code_style_all.sh --fix)
This commit is contained in:
committed by
Lorenz Meier
parent
a260a6eead
commit
968a3d499b
@@ -233,8 +233,8 @@ run_sitl_ros: sitl_deprecation
|
|||||||
# Other targets
|
# Other targets
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
||||||
.PHONY: gazebo_build uavcan_firmware check check_format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
.PHONY: gazebo_build uavcan_firmware check check_format format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
||||||
.NOTPARALLEL: gazebo_build uavcan_firmware check check_format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
.NOTPARALLEL: gazebo_build uavcan_firmware check check_format format unittest tests qgc_firmware package_firmware clean submodulesclean distclean
|
||||||
|
|
||||||
gazebo_build:
|
gazebo_build:
|
||||||
@mkdir -p build_gazebo
|
@mkdir -p build_gazebo
|
||||||
@@ -283,6 +283,11 @@ check_format:
|
|||||||
@./Tools/fix_code_style.sh
|
@./Tools/fix_code_style.sh
|
||||||
@./Tools/check_code_style_all.sh
|
@./Tools/check_code_style_all.sh
|
||||||
|
|
||||||
|
format:
|
||||||
|
$(call colorecho,"Formatting with astyle")
|
||||||
|
@./Tools/fix_code_style.sh
|
||||||
|
@./Tools/check_code_style_all.sh --fix
|
||||||
|
|
||||||
check_%:
|
check_%:
|
||||||
@echo
|
@echo
|
||||||
$(call colorecho,"Building" $(subst check_,,$@))
|
$(call colorecho,"Building" $(subst check_,,$@))
|
||||||
|
|||||||
@@ -16,8 +16,14 @@ then
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
rm -f $file.pretty
|
rm -f $file.pretty
|
||||||
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
|
||||||
exit 1
|
if [[ $PX4_ASTYLE_FIX -eq 1 ]]
|
||||||
|
then
|
||||||
|
${DIR}/fix_code_style.sh $file
|
||||||
|
else
|
||||||
|
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eu
|
set -eu
|
||||||
failed=0
|
|
||||||
|
if [[ "$@" == "--fix" ]]
|
||||||
|
then
|
||||||
|
export PX4_ASTYLE_FIX=1
|
||||||
|
fi
|
||||||
|
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|
||||||
find src/ \
|
find src/ \
|
||||||
|
-path src/lib/DriverFramework -prune -o \
|
||||||
|
-path src/lib/ecl -prune -o \
|
||||||
-path src/lib/external_lgpl -prune -o \
|
-path src/lib/external_lgpl -prune -o \
|
||||||
-path src/lib/mathlib -prune -o \
|
-path src/lib/mathlib -prune -o \
|
||||||
|
-path src/lib/matrix -prune -o \
|
||||||
-path src/modules/attitude_estimator_ekf -prune -o \
|
-path src/modules/attitude_estimator_ekf -prune -o \
|
||||||
-path src/modules/commander -prune -o \
|
-path src/modules/commander -prune -o \
|
||||||
-path src/modules/ekf2 -prune -o \
|
-path src/modules/ekf2 -prune -o \
|
||||||
|
|||||||
Reference in New Issue
Block a user