Skip to content

Commit a1ea21e

Browse files
authored
[Infrastructure] Configure clang-format to sort and group includes (#11448)
1 parent e1e1950 commit a1ea21e

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

.clang-format

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,60 @@ PenaltyBreakFirstLessLess: 120
3939
PenaltyBreakString: 1000
4040
PenaltyExcessCharacter: 1000000
4141
PenaltyReturnTypeOnItsOwnLine: 200
42-
SortIncludes: false
42+
SortIncludes: CaseSensitive
43+
IncludeBlocks: Regroup
44+
IncludeCategories:
45+
# O2Physics, PWG
46+
- Regex: ^(<|")PWG[A-Z]{2}/.*\.h
47+
Priority: 2
48+
CaseSensitive: true
49+
# O2Physics, non-PWG
50+
- Regex: ^(<|")(Common|ALICE3|DPG|EventFiltering|Tools|Tutorials)/.*\.h
51+
Priority: 3
52+
CaseSensitive: true
53+
# O2
54+
- Regex: ^(<|")(Algorithm|CCDB|Common[A-Z]|DataFormats|DCAFitter|Detectors|EMCAL|Field|Framework|FT0|FV0|GlobalTracking|ITS|MathUtils|MFT|MCH|MID|PHOS|PID|ReconstructionDataFormats|SimulationDataFormat|TOF|TPC|ZDC).*/.*\.h
55+
Priority: 4
56+
CaseSensitive: true
57+
# ROOT
58+
- Regex: ^(<|")(T[A-Z]|Math/|Roo[A-Z])[[:alnum:]/]+\.h
59+
Priority: 5
60+
CaseSensitive: true
61+
# known third-party: KFParticle
62+
- Regex: ^(<|")KF[A-Z][[:alnum:]]+\.h
63+
Priority: 6
64+
CaseSensitive: true
65+
# known third-party: FastJet
66+
- Regex: ^(<|")fastjet/
67+
Priority: 6
68+
CaseSensitive: true
69+
# known third-party: ONNX runtime
70+
- Regex: ^(<|")onnxruntime
71+
Priority: 6
72+
CaseSensitive: true
73+
# incomplete path to DataModel
74+
- Regex: ^(<|").*DataModel/
75+
Priority: 1
76+
CaseSensitive: true
77+
# other third-party
78+
- Regex: ^(<|")([[:alnum:]_]+/)+[[:alnum:]_]+\.h
79+
Priority: 6
80+
CaseSensitive: true
81+
# other local-looking file
82+
- Regex: ^".*\.
83+
Priority: 1
84+
CaseSensitive: true
85+
# C system
86+
- Regex: ^(<|")[[:lower:]_]+\.h(>|")
87+
Priority: 102
88+
CaseSensitive: true
89+
# C++ system
90+
- Regex: ^(<|")[[:lower:]_/]+(>|")
91+
Priority: 101
92+
CaseSensitive: true
93+
# rest
94+
- Regex: .*
95+
Priority: 100
4396
SpaceBeforeAssignmentOperators: true
4497
SpaceBeforeParens: ControlStatements
4598
SpaceInEmptyParentheses: false

CPPLINT.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
filter=-build/c++11,-build/namespaces,-readability/fn_size,-readability/todo,-runtime/references,-whitespace/blank_line,-whitespace/braces,-whitespace/comments,-whitespace/indent_namespace,-whitespace/line_length,-whitespace/semicolon,-whitespace/todo
1+
filter=-build/c++11,-build/include_order,-build/namespaces,-readability/fn_size,-readability/todo,-runtime/references,-whitespace/blank_line,-whitespace/braces,-whitespace/comments,-whitespace/indent_namespace,-whitespace/line_length,-whitespace/semicolon,-whitespace/todo

0 commit comments

Comments
 (0)