diff --git a/Firmware.sublime-project b/Firmware.sublime-project index b7aedaa185..5e97ff8b25 100644 --- a/Firmware.sublime-project +++ b/Firmware.sublime-project @@ -40,12 +40,12 @@ "options_c": { "use_only_additional_options": true, - "additional_options_file": "${project_path}/Tools/astylerc" + "additional_options_file": "${project_path}/Tools/astyle/astylerc" }, "options_c++": { "use_only_additional_options": true, - "additional_options_file": "${project_path}/Tools/astylerc" + "additional_options_file": "${project_path}/Tools/astyle/astylerc" } } }, diff --git a/Makefile b/Makefile index d4cf3e24cf..a1476c0ceb 100644 --- a/Makefile +++ b/Makefile @@ -300,12 +300,12 @@ s3put_coverage: tests_coverage check_format: $(call colorecho,"Checking formatting with astyle") - @$(SRC_DIR)/Tools/check_code_style_all.sh + @$(SRC_DIR)/Tools/astyle/check_code_style_all.sh @git diff --check format: $(call colorecho,"Formatting with astyle") - @$(SRC_DIR)/Tools/check_code_style_all.sh --fix + @$(SRC_DIR)/Tools/astyle/check_code_style_all.sh --fix # Testing # -------------------------------------------------------------------- diff --git a/Tools/astylerc b/Tools/astyle/astylerc similarity index 100% rename from Tools/astylerc rename to Tools/astyle/astylerc diff --git a/Tools/check_code_style.sh b/Tools/astyle/check_code_style.sh similarity index 93% rename from Tools/check_code_style.sh rename to Tools/astyle/check_code_style.sh index a93abbf878..ddf89e601e 100755 --- a/Tools/check_code_style.sh +++ b/Tools/astyle/check_code_style.sh @@ -16,7 +16,7 @@ if [ -f "$FILE" ]; then if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then ${DIR}/fix_code_style.sh $FILE else - echo $FILE 'bad formatting, please run "make format" or "./Tools/fix_code_style.sh' $FILE'"' + echo $FILE 'bad formatting, please run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"' exit 1 fi fi diff --git a/Tools/check_code_style_all.sh b/Tools/astyle/check_code_style_all.sh similarity index 90% rename from Tools/check_code_style_all.sh rename to Tools/astyle/check_code_style_all.sh index 24a254438e..df93e932ab 100755 --- a/Tools/check_code_style_all.sh +++ b/Tools/astyle/check_code_style_all.sh @@ -41,15 +41,15 @@ fi # install git pre-commit hook -HOOK_FILE="$DIR/../.git/hooks/pre-commit" +HOOK_FILE="$DIR/../../.git/hooks/pre-commit" if [ ! -f $HOOK_FILE ] && [ "$CI" != "true" ]; then echo "" echo -e "\033[31mNinja tip: add a git pre-commit hook to automatically check code style\033[0m" - echo -e "Would you like to install one now? (\033[94mcp ./Tools/pre-commit .git/hooks/pre-commit\033[0m): [y/\033[1mN\033[0m]" + echo -e "Would you like to install one now? (\033[94mcp ./Tools/astyle/pre-commit .git/hooks/pre-commit\033[0m): [y/\033[1mN\033[0m]" read user_cmd if [ "$user_cmd" == "y" ]; then - echo -e "copying ./Tools/pre-commit -> .git/hooks/pre-commit" + echo -e "copying ./Tools/astyle/pre-commit -> .git/hooks/pre-commit" mkdir -p $DIR/../.git/hooks cp $DIR/pre-commit $HOOK_FILE echo -e "\033[94mGreat, hook installed!\033[0m (checking style now)" diff --git a/Tools/files_to_check_code_style.sh b/Tools/astyle/files_to_check_code_style.sh similarity index 100% rename from Tools/files_to_check_code_style.sh rename to Tools/astyle/files_to_check_code_style.sh diff --git a/Tools/fix_code_style.sh b/Tools/astyle/fix_code_style.sh similarity index 100% rename from Tools/fix_code_style.sh rename to Tools/astyle/fix_code_style.sh diff --git a/Tools/pre-commit b/Tools/astyle/pre-commit similarity index 94% rename from Tools/pre-commit rename to Tools/astyle/pre-commit index a9de2e7615..d7fca3f31f 100755 --- a/Tools/pre-commit +++ b/Tools/astyle/pre-commit @@ -56,7 +56,7 @@ fi # Check for code style, only in changed files for i in `git diff --cached --name-only --diff-filter=ACM` do - ./Tools/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/check_code_style.sh % + ./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh % if [ $? -ne 0 ] then exit 1