forked from 4C-multiphysics/4C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
46 lines (38 loc) · 1.8 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
34
35
36
37
38
39
40
41
42
43
44
45
46
# Style configuration for 4C to be used with clang-format
#
# 4C's code style is based on the Google code style. However, we aggreed to deviate
# from it slightly to account enhance readability and to address 4C specifics.
## Define the base style. We use Google's style here.
BasedOnStyle: Google # Use Google style as baseline configuration and specify deviations explicitly as given below
## Define our deviations from the base style. Let's limit ourselves to very few exceptions.
AlignAfterOpenBracket: DontAlign # Align function arguments after line break at custom indentation rather than at the opening (
BreakBeforeBraces: Allman # Always move the opening { to the next line
ColumnLimit: 100 # Break lines after 100 columns/characters
MaxEmptyLinesToKeep: 3 # Max. number of emtpy lines
NamespaceIndentation: All # Add one level of indentation per namespace nesting
SpacesInContainerLiterals: false # Do not insert spaces after and before parenthesis, here []
Standard: c++17 # Use the Cpp17 code style
TabWidth: 2 # Make sure we use our desired tab width
IncludeBlocks: Regroup # group includes
SortIncludes: CaseInsensitive # Sort includes alphabetically
# Sort the includes into different categories
IncludeCategories:
# gtest and gmock first
- Regex: "gtest/gtest.h"
Priority: -3
- Regex: "gmock/gmock.h"
Priority: -2
# make sure to include config headers before other 4C headers:
- Regex: "4C_config.*.hpp"
Priority: -1
# the header associated with a cpp file has priority zero and would come here
# try to group 4C headers:
- Regex: "4C_.*\\.(h|H|hpp)"
Priority: 10
# try to catch all third party headers and put them after 4C but before
# standard headers:
- Regex: "<.*\\.(h|hpp|hxx)>"
Priority: 1000
# match all standard headers
- Regex: "<[a-z_]+>"
Priority: 100000