Sam Elliott | 7a98ea2 | 2020-05-11 14:59:07 +0100 | [diff] [blame] | 1 | # OpenTitan is still using clang-format 3.8, so the documentation for this |
| 2 | # configuration is here: |
| 3 | # https://releases.llvm.org/3.8.1/tools/docs/ClangFormatStyleOptions.html |
| 4 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 5 | BasedOnStyle: Google |
| 6 | AllowShortIfStatementsOnASingleLine: false |
| 7 | AllowShortLoopsOnASingleLine: false |
| 8 | DerivePointerAlignment: false |
| 9 | PointerAlignment: Right |
Sam Elliott | 7a98ea2 | 2020-05-11 14:59:07 +0100 | [diff] [blame] | 10 | |
| 11 | # Some of our headers in the sw/ tree are auto-generated, and it is useful to |
| 12 | # keep those with each other, and separate from hand-written headers. |
| 13 | # |
| 14 | # This is slightly more confusing as some headers are auto-generated at build |
| 15 | # time (*_regs.h), and some are auto-generated and checked in to the repo |
| 16 | # (hw/top_earlgrey/sw/autogen/*.h). These rules cover both occurences. |
| 17 | # |
| 18 | # The version of clang-format that we use does not regroup include statements, |
| 19 | # but this is something we could do in future. |
| 20 | IncludeCategories: |
| 21 | - # Generated Register Headers: #include "*_regs.h" |
| 22 | Regex: '_regs\.h"$' |
| 23 | Priority: 2 |
| 24 | - # Generated System Headers: #include "hw/**/autogen/*.h" |
| 25 | Regex: 'autogen' |
| 26 | Priority: 2 |
| 27 | - # All Other Headers |
| 28 | Regex: '.*' |
| 29 | Priority: 1 |