Skip to content

Commit 6057c8e

Browse files
[pre-commit.ci] pre-commit autoupdate (#182)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-clang-format: v19.1.7 → v20.1.0](pre-commit/mirrors-clang-format@v19.1.7...v20.1.0) - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.2](astral-sh/ruff-pre-commit@v0.9.9...v0.11.2) * add explict C settings in clang-format --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Richard Preen <rpreen@gmail.com>
1 parent 40893f7 commit 6057c8e

2 files changed

Lines changed: 136 additions & 2 deletions

File tree

.clang-format

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,140 @@
22
Language: Json
33
IndentWidth: 4
44
---
5+
Language: C
6+
AccessModifierOffset: -2
7+
AlignAfterOpenBracket: Align
8+
AlignConsecutiveMacros: false
9+
AlignConsecutiveAssignments: false
10+
AlignConsecutiveDeclarations: false
11+
AlignEscapedNewlines: Right
12+
AlignOperands: false
13+
AlignTrailingComments: false
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllConstructorInitializersOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: true
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: Empty
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: All
24+
AlwaysBreakAfterReturnType: All
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: MultiLine
27+
BinPackArguments: true
28+
BinPackParameters: true
29+
BraceWrapping:
30+
AfterCaseLabel: true
31+
AfterClass: false
32+
AfterControlStatement: false
33+
AfterEnum: false
34+
AfterFunction: false
35+
AfterNamespace: false
36+
AfterObjCDeclaration: false
37+
AfterStruct: false
38+
AfterUnion: false
39+
AfterExternBlock: false
40+
BeforeCatch: false
41+
BeforeElse: false
42+
IndentBraces: false
43+
SplitEmptyFunction: true
44+
SplitEmptyRecord: true
45+
SplitEmptyNamespace: true
46+
BreakBeforeBinaryOperators: None
47+
BreakBeforeBraces: Linux
48+
BreakBeforeInheritanceComma: false
49+
BreakInheritanceList: AfterColon
50+
BreakBeforeTernaryOperators: true
51+
BreakConstructorInitializersBeforeComma: true
52+
BreakConstructorInitializers: AfterColon
53+
BreakAfterJavaFieldAnnotations: true
54+
BreakStringLiterals: true
55+
ColumnLimit: 80
56+
CommentPragmas: '^ IWYU pragma:'
57+
CompactNamespaces: false
58+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
59+
ConstructorInitializerIndentWidth: 4
60+
ContinuationIndentWidth: 4
61+
Cpp11BracedListStyle: false
62+
DeriveLineEnding: true
63+
DerivePointerAlignment: false
64+
DisableFormat: false
65+
ExperimentalAutoDetectBinPacking: false
66+
FixNamespaceComments: true
67+
ForEachMacros:
68+
- foreach
69+
- Q_FOREACH
70+
- BOOST_FOREACH
71+
IncludeBlocks: Preserve
72+
IncludeCategories:
73+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
74+
Priority: 2
75+
SortPriority: 0
76+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
77+
Priority: 3
78+
SortPriority: 0
79+
- Regex: '.*'
80+
Priority: 1
81+
SortPriority: 0
82+
IncludeIsMainRegex: '(Test)?$'
83+
IncludeIsMainSourceRegex: ''
84+
IndentCaseLabels: true
85+
IndentGotoLabels: true
86+
IndentPPDirectives: BeforeHash
87+
IndentWidth: 4
88+
IndentWrappedFunctionNames: false
89+
JavaScriptQuotes: Leave
90+
JavaScriptWrapImports: true
91+
KeepEmptyLinesAtTheStartOfBlocks: true
92+
MacroBlockBegin: ''
93+
MacroBlockEnd: ''
94+
MaxEmptyLinesToKeep: 1
95+
NamespaceIndentation: None
96+
ObjCBinPackProtocolList: Auto
97+
ObjCBlockIndentWidth: 2
98+
ObjCSpaceAfterProperty: false
99+
ObjCSpaceBeforeProtocolList: true
100+
PenaltyBreakAssignment: 2
101+
PenaltyBreakBeforeFirstCallParameter: 19
102+
PenaltyBreakComment: 300
103+
PenaltyBreakFirstLessLess: 120
104+
PenaltyBreakString: 1000
105+
PenaltyBreakTemplateDeclaration: 10
106+
PenaltyExcessCharacter: 1000000
107+
PenaltyReturnTypeOnItsOwnLine: 60
108+
PointerAlignment: Right
109+
ReflowComments: true
110+
SortIncludes: true
111+
SortUsingDeclarations: true
112+
SpaceAfterCStyleCast: true
113+
SpaceAfterLogicalNot: false
114+
SpaceAfterTemplateKeyword: true
115+
SpaceBeforeAssignmentOperators: true
116+
SpaceBeforeCpp11BracedList: false
117+
SpaceBeforeCtorInitializerColon: true
118+
SpaceBeforeInheritanceColon: true
119+
SpaceBeforeParens: ControlStatements
120+
SpaceBeforeRangeBasedForLoopColon: true
121+
SpaceInEmptyBlock: false
122+
SpaceInEmptyParentheses: false
123+
SpacesBeforeTrailingComments: 1
124+
SpacesInAngles: false
125+
SpacesInConditionalStatement: false
126+
SpacesInContainerLiterals: true
127+
SpacesInCStyleCastParentheses: false
128+
SpacesInParentheses: false
129+
SpacesInSquareBrackets: false
130+
SpaceBeforeSquareBrackets: false
131+
Standard: Latest
132+
StatementMacros:
133+
- Q_UNUSED
134+
- QT_REQUIRE_VERSION
135+
TabWidth: 4
136+
UseCRLF: false
137+
UseTab: Never
138+
---
5139
Language: Cpp
6140
AccessModifierOffset: -2
7141
AlignAfterOpenBracket: Align

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
4040
# Clang format
4141
- repo: https://github.com/pre-commit/mirrors-clang-format
42-
rev: v19.1.7
42+
rev: v20.1.0
4343
hooks:
4444
- id: clang-format
4545
types_or: [c++, c, cuda]
@@ -55,7 +55,7 @@ repos:
5555

5656
# Ruff, the Python auto-correcting linter/formatter written in Rust
5757
- repo: https://github.com/astral-sh/ruff-pre-commit
58-
rev: v0.9.9
58+
rev: v0.11.2
5959
hooks:
6060
- id: ruff
6161
args: ["--fix", "--show-fixes", "--exclude=__init__.py"]

0 commit comments

Comments
 (0)