Skip to content

Commit c73b9f0

Browse files
committed
STYLE: Allow hdf5 to specify it's own clang-format
1 parent 95b3437 commit c73b9f0

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

Modules/ThirdParty/HDF5/UpdateFromUpstream.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ readonly paths="
3131
hl/c++/CMakeLists.txt
3232
hl/c++/src
3333
UserMacros.cmake
34+
.clang-format
3435
"
3536

3637
extract_source () {
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
AlignConsecutiveAssignments: true
5+
#llvm11: AlignConsecutiveBitFields: false
6+
AlignConsecutiveDeclarations: true
7+
AlignConsecutiveMacros: true
8+
#llvm10-11: AlignOperands: true - Align
9+
#llvm11: AllowShortEnumsOnASingleLine: true
10+
AllowShortFunctionsOnASingleLine: None
11+
AlwaysBreakAfterReturnType: AllDefinitions
12+
# Can enable the following section when llvm 12.x is out
13+
#AttributeMacros:
14+
# - H5_ATTR_FORMAT
15+
# - H5_ATTR_UNUSED
16+
# - H5_ATTR_DEPRECATED_USED
17+
# - H5_ATTR_NDEBUG_UNUSED
18+
# - H5_ATTR_DEBUG_API_USED
19+
# - H5_ATTR_PARALLEL_UNUSED
20+
# - H5_ATTR_PARALLEL_USED
21+
# - H5_ATTR_NORETURN
22+
# - H5_ATTR_CONST
23+
# - H5_ATTR_PURE
24+
# - H5_ATTR_FALLTHROUGH
25+
BraceWrapping:
26+
AfterFunction: true
27+
#llvm10-11: AfterControlStatement: false - Never
28+
BeforeCatch: true
29+
BeforeElse: true
30+
#llvm11: BeforeLambdaBody: false
31+
#llvm11: BeforeWhile: false
32+
BreakBeforeBraces: Stroustrup
33+
BreakAfterJavaFieldAnnotations: true
34+
BreakStringLiterals: true
35+
ColumnLimit: 110 # Update $max_trace_macro_line_len in bin/trace also
36+
ForEachMacros: ['ALL_MEMBERS', 'UNIQUE_MEMBERS']
37+
IncludeCategories:
38+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
39+
Priority: 3
40+
SortPriority: 0
41+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
42+
Priority: 4
43+
SortPriority: 0
44+
- Regex: '.*'
45+
Priority: 0
46+
SortPriority: 0
47+
- Regex: '^H5*.*'
48+
Priority: 1
49+
SortPriority: 0
50+
- Regex: 'private.*'
51+
Priority: 2
52+
SortPriority: 0
53+
IncludeIsMainRegex: '(public)?$'
54+
IndentCaseLabels: true
55+
#llvm11: IndentCaseBlocks: false
56+
IndentGotoLabels: false
57+
#llvm11: IndentExternBlock: AfterExternBlock
58+
IndentWidth: 4
59+
#llvm11: InsertTrailingCommas: None
60+
MacroBlockBegin: "^BEGIN_FUNC"
61+
MacroBlockEnd: "^END_FUNC"
62+
ObjCBlockIndentWidth: 4
63+
#llvm11: ObjCBreakBeforeNestedBlockParam: true
64+
ReflowComments: true
65+
SortIncludes: false
66+
StatementMacros:
67+
- FUNC_ENTER_API
68+
- FUNC_LEAVE_API
69+
- FUNC_ENTER_NOAPI_NOINIT_NOERR
70+
- FUNC_LEAVE_NOAPI
71+
- H5_BEGIN_TAG
72+
- HGOTO_DONE_TAG
73+
- H5_END_TAG
74+
- HSYS_DONE_ERROR
75+
- HSYS_GOTO_ERROR
76+
- HDONE_ERROR
77+
- HERROR
78+
- H5_LEAVE
79+
- H5E_PRINTF
80+
- H5E_THROW
81+
- HGOTO_DONE
82+
- HGOTO_ERROR
83+
- HMPI_ERROR
84+
- HMPI_DONE_ERROR
85+
- HMPI_GOTO_ERROR
86+
- H5_GCC_DIAG_OFF
87+
- H5_GCC_DIAG_ON
88+
- CATCH
89+
#llvm10: TypenameMacros:
90+
#llvm10: - STACK_OF
91+
#llvm10: - LIST
92+
#llvm11: WhitespaceSensitiveMacros:
93+
#llvm11: - STRINGIZE
94+
#llvm11: - PP_STRINGIZE
95+
...
96+

0 commit comments

Comments
 (0)