Skip to content

Commit

Permalink
astyle scripting move to Tools/astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar authored and LorenzMeier committed Aug 23, 2017
1 parent a02caff commit 9f15c57
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Firmware.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
# --------------------------------------------------------------------
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Tools/pre-commit → Tools/astyle/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f15c57

Please sign in to comment.