blob: 9f7b3dc6591f7ef7aa6027075916c8c0cd6e8871 [file] [log] [blame]
Sam Elliott7a98ea22020-05-11 14:59:07 +01001# 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 Contributors802543a2019-08-31 12:12:56 +01005BasedOnStyle: Google
6AllowShortIfStatementsOnASingleLine: false
7AllowShortLoopsOnASingleLine: false
8DerivePointerAlignment: false
9PointerAlignment: Right
Sam Elliott7a98ea22020-05-11 14:59:07 +010010
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.
20IncludeCategories:
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