mirror of https://github.com/ARMmbed/mbed-os.git
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 ```pull/6590/head
parent
f6541f9fc8
commit
7ba0e90f02
14
.astylerc
14
.astylerc
|
@ -10,16 +10,14 @@ style=kr
|
||||||
# Use -j as it was changed in astyle from brackets to braces, this way it is compatible with older astyle versions
|
# Use -j as it was changed in astyle from brackets to braces, this way it is compatible with older astyle versions
|
||||||
-j
|
-j
|
||||||
|
|
||||||
# 4 spaces, no tabs
|
# 4 spaces, convert tabs to spaces
|
||||||
indent=spaces=4
|
indent=spaces=4
|
||||||
convert-tabs
|
convert-tabs
|
||||||
|
|
||||||
|
# Indent switches and cases
|
||||||
indent-switches
|
indent-switches
|
||||||
indent-cases
|
indent-cases
|
||||||
|
|
||||||
# Comments should be indented
|
|
||||||
indent-col1-comments
|
|
||||||
|
|
||||||
# Remove spaces in and around parentheses
|
# Remove spaces in and around parentheses
|
||||||
unpad-paren
|
unpad-paren
|
||||||
|
|
||||||
|
@ -31,12 +29,6 @@ pad-oper
|
||||||
align-pointer=name
|
align-pointer=name
|
||||||
align-reference=name
|
align-reference=name
|
||||||
|
|
||||||
# Attach { to the classes and namespaces
|
# Attach { for classes and namespaces
|
||||||
attach-namespaces
|
attach-namespaces
|
||||||
attach-classes
|
attach-classes
|
||||||
|
|
||||||
# add braces to one liners
|
|
||||||
add-braces
|
|
||||||
|
|
||||||
# Don't limit spaces in a continous statement (default is 40)
|
|
||||||
max-instatement-indent=120
|
|
||||||
|
|
Loading…
Reference in New Issue