|
| 1 | +# source: https://github.com/arduino/ArduinoCore-avr/issues/71#issuecomment-466763471 2019-06-09 |
| 2 | + |
| 3 | +# formatter.conf, examples_formatter.conf |
| 4 | +mode=c |
| 5 | + |
| 6 | + |
| 7 | +# examples_formatter.conf |
| 8 | +# http://astyle.sourceforge.net/astyle.html#_style=java |
| 9 | +# Considering changing this to the synonym "style=attach", which seems more descriptive |
| 10 | +style=java |
| 11 | + |
| 12 | + |
| 13 | +# examples_formatter.conf |
| 14 | +attach-namespaces |
| 15 | + |
| 16 | +# examples_formatter.conf |
| 17 | +attach-classes |
| 18 | + |
| 19 | +# examples_formatter.conf |
| 20 | +attach-inlines |
| 21 | + |
| 22 | +# examples_formatter.conf |
| 23 | +attach-extern-c |
| 24 | + |
| 25 | + |
| 26 | +# formatter.conf, examples_formatter.conf |
| 27 | +indent=spaces=2 |
| 28 | + |
| 29 | +# formatter.conf, examples_formatter.conf |
| 30 | +indent-classes |
| 31 | + |
| 32 | +# formatter.conf, examples_formatter.conf |
| 33 | +indent-switches |
| 34 | + |
| 35 | +# formatter.conf, examples_formatter.conf |
| 36 | +indent-cases |
| 37 | + |
| 38 | +# formatter.conf, examples_formatter.conf |
| 39 | +indent-col1-comments |
| 40 | + |
| 41 | +# examples_formatter.conf |
| 42 | +indent-modifiers |
| 43 | + |
| 44 | +# examples_formatter.conf |
| 45 | +indent-namespaces |
| 46 | + |
| 47 | +# examples_formatter.conf |
| 48 | +indent-labels |
| 49 | + |
| 50 | +# examples_formatter.conf |
| 51 | +indent-preproc-define |
| 52 | + |
| 53 | + |
| 54 | +# formatter.conf, examples_formatter.conf |
| 55 | +pad-header |
| 56 | + |
| 57 | +# formatter.conf, examples_formatter.conf |
| 58 | +pad-oper |
| 59 | + |
| 60 | +# examples_formatter.conf |
| 61 | +unpad-paren |
| 62 | + |
| 63 | + |
| 64 | +# formatter.conf, examples_formatter.conf |
| 65 | +remove-comment-prefix |
| 66 | + |
| 67 | +# formatter.conf, examples_formatter.conf |
| 68 | +# http://astyle.sourceforge.net/astyle.html#_keep-one-line-statements |
| 69 | +# "Don't break complex statements and multiple statements residing on a single line." |
| 70 | +# I don't like one line complex statements, but I guess since it's in formatter.conf it must stay. |
| 71 | +keep-one-line-statements |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +# Options from examples_formatter.conf that I think should be removed: |
| 76 | + |
| 77 | +# http://astyle.sourceforge.net/astyle.html#_indent-preproc-block |
| 78 | +# "Indent preprocessor blocks at brace level zero and immediately within a namespace. There are restrictions on what will be indented. Blocks within methods, classes, arrays, etc., will not be indented. Blocks containing braces or multi-line define statements will not be indented. Without this option the preprocessor block is not indented." |
| 79 | +# This does indent for #ifdef, but not for #ifndef, so it's quite inconsistent |
| 80 | +# Indentation of preprocessor directives as done by this option is not very common in Arduino AVR Boards core, and where it is used, it's typically done inconsistently throughout the file |
| 81 | +indent-preproc-block |
| 82 | + |
| 83 | +# http://astyle.sourceforge.net/astyle.html#_indent-preproc-cond |
| 84 | +# "Indent preprocessor conditional statements to the same level as the source code." |
| 85 | +# Indentation of preprocessor directives as done by this option is very rare in Arduino AVR Boards core |
| 86 | +indent-preproc-cond |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +# Options I have not implemented from formatter.conf or examples_formatter.conf: |
| 91 | + |
| 92 | +# examples_formatter.conf |
| 93 | +# Not a valid option in the latest version of AStyle. I think the correct option name is "add-braces", which I do use in my configuration |
| 94 | +# add-brackets |
| 95 | + |
| 96 | +# formatter.conf, examples_formatter.conf |
| 97 | +# Not a valid option in the latest version of AStyle. |
| 98 | +# indent-preprocessor |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +# Options I have added: |
| 103 | + |
| 104 | +# http://astyle.sourceforge.net/astyle.html#_add-braces |
| 105 | +# "I believe this is the correct option name to use instead the "add-brackets" option used in examples_formatter.conf. "add-brackets" is not a valid option in the latest version of AStyle" |
| 106 | +add-braces |
| 107 | + |
| 108 | +# http://astyle.sourceforge.net/astyle.html#_convert-tabs |
| 109 | +# "Converts tabs into spaces in the non-indentation part of the line." |
| 110 | +# AStyle is already configured to use spaces for indentation by indent=spaces=2. The Arduino IDE uses spaces instead of tabs by default. |
| 111 | +convert-tabs |
| 112 | + |
| 113 | +# http://astyle.sourceforge.net/astyle.html#_attach-return-type |
| 114 | +# "Attach the return type to the function name in function definitions." |
| 115 | +attach-return-type |
| 116 | + |
| 117 | +# http://astyle.sourceforge.net/astyle.html#_attach-return-type |
| 118 | +# "Attach the return type to the function name in function declarations." |
| 119 | +attach-return-type-decl |
| 120 | + |
| 121 | +# http://astyle.sourceforge.net/astyle.html#_align-pointer |
| 122 | +# "Attach a pointer or reference operator (*, &, or ^) to either the variable type (left) or variable name (right), or place it between the type and name (middle)." |
| 123 | +# In Arduino AVR Boards core, name alignment of pointers is somewhat more common, though all possible styles are used |
| 124 | +# I don't care which style is chosen (type, middle, name), but I do think one should be chosen and used. |
| 125 | +align-pointer=name |
0 commit comments