Skip to content

Commit 28169f6

Browse files
committed
Add explanatory comments to .clang-format IncludeCategories
Document the evaluation order, priority levels, and category intent for each rule governing header sorting and block regrouping. Assisted-by: Jetski:Gemini Next
1 parent c84abda commit 28169f6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.clang-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@
1919
# of the below options.
2020

2121
BasedOnStyle: Google
22+
# Enforce grouping and sorting of #include directives into distinct blocks
23+
# separated by a blank line, evaluated in the order listed below:
2224
IncludeBlocks: Regroup
2325
IncludeCategories:
26+
# 1. Project headers (cuttlefish/, allocd/, and external_proto/)
2427
- Regex: '^[<"](cuttlefish|allocd|external_proto)/'
2528
Priority: 4
29+
# 2. Plain C external third-party library headers inside angle brackets
2630
- Regex: '^<(zip|zlib|png|lz4|archive|tinyxml2|pcre2)\.h>'
2731
Priority: 3
32+
# 3. C/POSIX system headers (any other angle-bracket header ending in .h)
2833
- Regex: '^<.*\.h>'
2934
Priority: 1
35+
# 4. C++ standard library headers (extensionless angle-bracket headers)
3036
- Regex: '^<[a-z_]*>'
3137
Priority: 2
38+
# 5. External third-party library headers inside double quotes
3239
- Regex: '.*'
3340
Priority: 3

0 commit comments

Comments
 (0)