| 1 |
# Options for formatting code with astyle. |
| 2 |
# |
| 3 |
# This helps to make code match the style guide. |
| 4 |
# |
| 5 |
# Use like this: |
| 6 |
# |
| 7 |
# astyle --options=astyle-config mfile.h myfile.cpp |
| 8 |
# |
| 9 |
# Occasionally, astyle does something silly (particularly with lambdas), so it's |
| 10 |
# still necessary to scan the changes for things that are wrong. |
| 11 |
# But, for most files, it does a good job. |
| 12 |
# |
| 13 |
# Please consider using this before checking code in for review. Code reviews shouldn't |
| 14 |
# have to deal with layout issues, they are just a distraction. It's better to be able |
| 15 |
# to focus on semantics in a code review, with style issues out of the way. |
| 16 |
|
| 17 |
--formatted |
| 18 |
--style=allman |
| 19 |
--min-conditional-indent=2 |
| 20 |
--indent-switches |
| 21 |
--max-instatement-indent=120 |
| 22 |
--pad-header |
| 23 |
--align-pointer=type |
| 24 |
--align-reference=type |
| 25 |
--convert-tabs |
| 26 |
--close-templates |
| 27 |
--max-code-length=120 |
| 28 |
|
| 29 |
# --pad-oper |
| 30 |
# |
| 31 |
# Commented out for now. It changes |
| 32 |
# |
| 33 |
# for (int i=0; i<10; ++i) |
| 34 |
# to |
| 35 |
# for (int i = 0; i < 10; ++i) |
| 36 |
# |
| 37 |
# Unfortunately, it also messes with rvalue references: |
| 38 |
# |
| 39 |
# ResourcePtr& operator=(ResourcePtr&& r); |
| 40 |
# |
| 41 |
# becomes: |
| 42 |
# |
| 43 |
# ResourcePtr& operator=(ResourcePtr && r); |