From 7ba0e90f0252e58b1a667018866ccebcaa0750c3 Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Tue, 27 Feb 2018 11:05:40 +0000 Subject: [PATCH] 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 ``` --- .astylerc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.astylerc b/.astylerc index 82ce783af7..b208b767a7 100644 --- a/.astylerc +++ b/.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 -j -# 4 spaces, no tabs +# 4 spaces, convert tabs to spaces indent=spaces=4 convert-tabs +# Indent switches and cases indent-switches indent-cases -# Comments should be indented -indent-col1-comments - # Remove spaces in and around parentheses unpad-paren @@ -31,12 +29,6 @@ pad-oper align-pointer=name align-reference=name -# Attach { to the classes and namespaces +# Attach { for classes and namespaces attach-namespaces attach-classes - -# add braces to one liners -add-braces - -# Don't limit spaces in a continous statement (default is 40) -max-instatement-indent=120