Browse Source

moving astyle options into astyle options file, adding sublime settings for astyle formatter plugin

sbg
Andreas Antener 10 years ago
parent
commit
9ad5dfc928
  1. 15
      Firmware.sublime-project
  2. 18
      Tools/astylerc
  3. 20
      Tools/fix_code_style.sh

15
Firmware.sublime-project vendored

@ -33,7 +33,20 @@ @@ -33,7 +33,20 @@
{
"tab_size": 8,
"translate_tabs_to_spaces": false,
"highlight_line": true
"highlight_line": true,
"AStyleFormatter":
{
"options_c":
{
"use_only_additional_options": true,
"additional_options_file": "${project_path}/Tools/astylerc"
},
"options_c++":
{
"use_only_additional_options": true,
"additional_options_file": "${project_path}/Tools/astylerc"
}
}
},
"build_systems":
[

18
Tools/astylerc

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
indent=force-tab=8
style=linux
indent-preprocessor
indent-cases
break-blocks=all
pad-oper
pad-header
unpad-paren
keep-one-line-blocks
keep-one-line-statements
align-pointer=name
align-reference=name
-n #--suffix=none
ignore-exclude-errors-x
lineend=linux
exclude=EASTL
add-brackets
max-code-length=120

20
Tools/fix_code_style.sh

@ -1,22 +1,6 @@ @@ -1,22 +1,6 @@
#!/bin/sh
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
astyle \
--style=linux \
--indent=force-tab=8 \
--indent-cases \
--indent-preprocessor \
--break-blocks=all \
--pad-oper \
--pad-header \
--unpad-paren \
--keep-one-line-blocks \
--keep-one-line-statements \
--align-pointer=name \
--align-reference=name \
--suffix=none \
--ignore-exclude-errors-x \
--lineend=linux \
--exclude=EASTL \
--add-brackets \
--max-code-length=120 \
--options=$DIR/astylerc \
--preserve-date \
$*

Loading…
Cancel
Save