forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
33 lines (31 loc) · 1.16 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# OpenTitan CI is using clang-format from the bazel workspace
# Documentation for this configuration is here:
# https://releases.llvm.org/6.0.0/tools/clang/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
DerivePointerAlignment: false
PointerAlignment: Right
# Some of our headers in the sw/ tree are auto-generated, and it is useful to
# keep those with each other, and separate from system headers and hand-written
# project headers.
#
# This is slightly more confusing as some headers are auto-generated at build
# time (*_regs.h), and some are auto-generated and checked in to the repo
# (hw/top_earlgrey/sw/autogen/*.h). These rules cover both occurences.
#
# The version of clang-format that we use does not regroup include statements,
# but this is something we could do in future.
IncludeCategories:
- # System Headers: #include <*>
Regex: '^<.*>$'
Priority: 1
- # Generated Register Headers: #include "*_regs.h"
Regex: '_regs\.h"$'
Priority: 3
- # Generated System Headers: #include "hw/**/autogen/*.h"
Regex: 'autogen'
Priority: 3
- # All Other Headers
Regex: '.*'
Priority: 2