diff --git a/Makefile b/Makefile index 88df8d7b589f..3cffdb0613cc 100644 --- a/Makefile +++ b/Makefile @@ -126,11 +126,11 @@ define cmake-build +@(cd $(BUILD_DIR) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS)) endef -COLOR_BLUE = \033[0;34m +COLOR_BLUE = \033[0;94m NO_COLOR = \033[m define colorecho -+@echo "${COLOR_BLUE}${1} ${NO_COLOR}" ++@echo -e '${COLOR_BLUE}${1} ${NO_COLOR}' endef # Get a list of all config targets cmake/configs/*.cmake @@ -231,7 +231,7 @@ quick_check: check_posix_sitl_default check_px4fmu-v4pro_default tests check_for check_%: @echo - $(call colorecho,"Building" $(subst check_,,$@)) + $(call colorecho,'Building' $(subst check_,,$@)) @$(MAKE) --no-print-directory $(subst check_,,$@) @echo @@ -269,12 +269,12 @@ px4_metadata: parameters_metadata airframe_metadata module_documentation .PHONY: check_format format check_format: - $(call colorecho,"Checking formatting with astyle") + $(call colorecho,'Checking formatting with astyle') @$(SRC_DIR)/Tools/astyle/check_code_style_all.sh @cd $(SRC_DIR) && git diff --check format: - $(call colorecho,"Formatting with astyle") + $(call colorecho,'Formatting with astyle') @$(SRC_DIR)/Tools/astyle/check_code_style_all.sh --fix # Testing diff --git a/Tools/astyle/check_code_style.sh b/Tools/astyle/check_code_style.sh index ddf89e601e6e..b1154911ba52 100755 --- a/Tools/astyle/check_code_style.sh +++ b/Tools/astyle/check_code_style.sh @@ -4,8 +4,8 @@ FILE=$1 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) if [ -f "$FILE" ]; then - ${DIR}/fix_code_style.sh --dry-run $FILE | grep --quiet Formatted - if [[ $? -eq 0 ]]; then + CHECK_FAILED=$(${DIR}/fix_code_style.sh --dry-run --formatted $FILE) + if [ -n "$CHECK_FAILED" ]; then ${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty echo