Browse Source

astyle scripting move to Tools/astyle

sbg
Daniel Agar 8 years ago committed by Lorenz Meier
parent
commit
9f15c572a3
  1. 4
      Firmware.sublime-project
  2. 4
      Makefile
  3. 0
      Tools/astyle/astylerc
  4. 2
      Tools/astyle/check_code_style.sh
  5. 6
      Tools/astyle/check_code_style_all.sh
  6. 0
      Tools/astyle/files_to_check_code_style.sh
  7. 0
      Tools/astyle/fix_code_style.sh
  8. 2
      Tools/astyle/pre-commit

4
Firmware.sublime-project vendored

@ -40,12 +40,12 @@ @@ -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"
}
}
},

4
Makefile

@ -300,12 +300,12 @@ s3put_coverage: tests_coverage @@ -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
# --------------------------------------------------------------------

0
Tools/astylerc → Tools/astyle/astylerc

2
Tools/check_code_style.sh → Tools/astyle/check_code_style.sh

@ -16,7 +16,7 @@ if [ -f "$FILE" ]; then @@ -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

6
Tools/check_code_style_all.sh → Tools/astyle/check_code_style_all.sh

@ -41,15 +41,15 @@ fi @@ -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)"

0
Tools/files_to_check_code_style.sh → Tools/astyle/files_to_check_code_style.sh

0
Tools/fix_code_style.sh → Tools/astyle/fix_code_style.sh

2
Tools/pre-commit → Tools/astyle/pre-commit

@ -56,7 +56,7 @@ fi @@ -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
Loading…
Cancel
Save