Skip to content

Commit 7ba0e90

Browse files
committed
AStyle: options update
This should reflect these rules that we have defined since mbed 2: ``` Indentation - 4 spaces. Please do not use tabs. Braces - K&R (see the exception 1 TBS below) 1 TBS -use braces for statements if, else, while, for (exception from K&R) Reference: http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS One line per statement Preprocessor macro starts at the beginning of a new line, the code inside is indented accordingly the code above it Cases within switch are indented (exception from K&R) Space after statements if, while, for, switch, same applies to binary and ternary operators Each line has preferably at most 120 characters For pointers, '*' is adjacent to a data name (analogin_t *obj) or a function name (analog_t *get_analogin_object()) Don't leave trailing spaces at the end of lines Empty lines should have no trailing spaces Unix line endings are default option for files Use capital letters for macros A file should have an empty line at the end ```
1 parent f6541f9 commit 7ba0e90

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

.astylerc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ style=kr
1010
# Use -j as it was changed in astyle from brackets to braces, this way it is compatible with older astyle versions
1111
-j
1212

13-
# 4 spaces, no tabs
13+
# 4 spaces, convert tabs to spaces
1414
indent=spaces=4
1515
convert-tabs
1616

17+
# Indent switches and cases
1718
indent-switches
1819
indent-cases
1920

20-
# Comments should be indented
21-
indent-col1-comments
22-
2321
# Remove spaces in and around parentheses
2422
unpad-paren
2523

@@ -31,12 +29,6 @@ pad-oper
3129
align-pointer=name
3230
align-reference=name
3331

34-
# Attach { to the classes and namespaces
32+
# Attach { for classes and namespaces
3533
attach-namespaces
3634
attach-classes
37-
38-
# add braces to one liners
39-
add-braces
40-
41-
# Don't limit spaces in a continous statement (default is 40)
42-
max-instatement-indent=120

0 commit comments

Comments
 (0)