Skip to content

Commit

Permalink
Add include groups to clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Feb 27, 2024
1 parent eac7587 commit 2392d75
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions cpp/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
Expand All @@ -27,7 +27,7 @@ AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
Expand Down Expand Up @@ -71,8 +71,28 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"' # quoted includes
Priority: 1
- Regex: '^<(benchmarks|tests)/' # benchmark includes
Priority: 2
- Regex: '^<(cuspatial_test|cuproj_test)/' # cuSpatial/cuProj test includes
Priority: 3
- Regex: '^<(cuspatial|cuproj)/' # cuSpatial/cuProj includes
Priority: 4
- Regex: '^<(cudf_test|cudf|cuml|raft|kvikio)' # Other RAPIDS includes
Priority: 5
- Regex: '^<rmm/' # RMM includes
Priority: 6
- Regex: '^<(thrust|cub|cuda)/' # CCCL includes
Priority: 7
- Regex: '^<(cooperative_groups|cuco|cuda.h|cuda_runtime|device_types|driver_types|math_constants|nvtx3)' # CUDA includes
Priority: 8
- Regex: '^<.*\..*' # other system includes (e.g. with a '.')
Priority: 9
- Regex: '^<[^.]+' # STL includes (no '.')
Priority: 10
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
Expand Down

0 comments on commit 2392d75

Please sign in to comment.