Skip to content

Commit 388682b

Browse files
committed
Update pre-commit hooks and clang-format
Change-Id: I4dafc7afb3e90ad1f14f342b3865cfcc0b84db5f Reviewed-on: https://review.couchbase.org/c/couchbase-python-client/+/211375 Reviewed-by: Dimitris Christodoulou <dimitris.christodoulou@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
1 parent c3e29d6 commit 388682b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+18290
-16995
lines changed

.clang-format

Lines changed: 251 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,258 @@
11
# -*- mode: yaml; -*-
22

3+
---
4+
# Generated with: clang-format 18.1.6
5+
# clang-format --style=Mozilla --dump-config
6+
AccessModifierOffset: -2
7+
AlignAfterOpenBracket: Align
8+
AlignArrayOfStructures: None
9+
AlignConsecutiveAssignments:
10+
Enabled: false
11+
AcrossEmptyLines: false
12+
AcrossComments: false
13+
AlignCompound: false
14+
AlignFunctionPointers: false
15+
PadOperators: true
16+
AlignConsecutiveBitFields:
17+
Enabled: false
18+
AcrossEmptyLines: false
19+
AcrossComments: false
20+
AlignCompound: false
21+
AlignFunctionPointers: false
22+
PadOperators: false
23+
AlignConsecutiveDeclarations:
24+
Enabled: false
25+
AcrossEmptyLines: false
26+
AcrossComments: false
27+
AlignCompound: false
28+
AlignFunctionPointers: false
29+
PadOperators: false
30+
AlignConsecutiveMacros:
31+
Enabled: false
32+
AcrossEmptyLines: false
33+
AcrossComments: false
34+
AlignCompound: false
35+
AlignFunctionPointers: false
36+
PadOperators: false
37+
AlignConsecutiveShortCaseStatements:
38+
Enabled: false
39+
AcrossEmptyLines: false
40+
AcrossComments: false
41+
AlignCaseColons: false
42+
AlignEscapedNewlines: Right
43+
AlignOperands: Align
44+
AlignTrailingComments:
45+
Kind: Always
46+
OverEmptyLines: 0
47+
AllowAllArgumentsOnNextLine: true
48+
AllowAllParametersOfDeclarationOnNextLine: false
49+
AllowBreakBeforeNoexceptSpecifier: Never
50+
AllowShortBlocksOnASingleLine: Never
51+
AllowShortCaseLabelsOnASingleLine: false
52+
AllowShortCompoundRequirementOnASingleLine: true
53+
AllowShortEnumsOnASingleLine: true
54+
AllowShortFunctionsOnASingleLine: Inline
55+
AllowShortIfStatementsOnASingleLine: Never
56+
AllowShortLambdasOnASingleLine: All
57+
AllowShortLoopsOnASingleLine: false
58+
AlwaysBreakAfterDefinitionReturnType: TopLevel
59+
AlwaysBreakAfterReturnType: TopLevel
60+
AlwaysBreakBeforeMultilineStrings: false
61+
AlwaysBreakTemplateDeclarations: Yes
62+
AttributeMacros:
63+
- __capability
64+
BinPackArguments: false
65+
BinPackParameters: false
66+
BitFieldColonSpacing: Both
67+
BraceWrapping:
68+
AfterCaseLabel: false
69+
AfterClass: true
70+
AfterControlStatement: Never
71+
AfterEnum: true
72+
AfterExternBlock: true
73+
AfterFunction: true
74+
AfterNamespace: false
75+
AfterObjCDeclaration: false
76+
AfterStruct: true
77+
AfterUnion: true
78+
BeforeCatch: false
79+
BeforeElse: false
80+
BeforeLambdaBody: false
81+
BeforeWhile: false
82+
IndentBraces: false
83+
SplitEmptyFunction: true
84+
SplitEmptyRecord: false
85+
SplitEmptyNamespace: true
86+
BreakAdjacentStringLiterals: true
87+
BreakAfterAttributes: Leave
88+
BreakAfterJavaFieldAnnotations: false
89+
BreakArrays: true
90+
BreakBeforeBinaryOperators: None
91+
BreakBeforeConceptDeclarations: Always
92+
BreakBeforeBraces: Mozilla
93+
BreakBeforeInlineASMColon: OnlyMultiline
94+
BreakBeforeTernaryOperators: true
95+
BreakConstructorInitializers: BeforeComma
96+
BreakInheritanceList: BeforeComma
97+
BreakStringLiterals: true
98+
ColumnLimit: 80
99+
CommentPragmas: '^ IWYU pragma:'
100+
CompactNamespaces: false
101+
ConstructorInitializerIndentWidth: 2
102+
ContinuationIndentWidth: 2
103+
Cpp11BracedListStyle: false
104+
DerivePointerAlignment: false
105+
DisableFormat: false
106+
EmptyLineAfterAccessModifier: Never
107+
EmptyLineBeforeAccessModifier: LogicalBlock
108+
ExperimentalAutoDetectBinPacking: false
109+
FixNamespaceComments: false
110+
ForEachMacros:
111+
- foreach
112+
- Q_FOREACH
113+
- BOOST_FOREACH
114+
IfMacros:
115+
- KJ_IF_MAYBE
116+
IncludeBlocks: Preserve
117+
IncludeCategories:
118+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
119+
Priority: 2
120+
SortPriority: 0
121+
CaseSensitive: false
122+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
123+
Priority: 3
124+
SortPriority: 0
125+
CaseSensitive: false
126+
- Regex: '.*'
127+
Priority: 1
128+
SortPriority: 0
129+
CaseSensitive: false
130+
IncludeIsMainRegex: '(Test)?$'
131+
IncludeIsMainSourceRegex: ''
132+
IndentAccessModifiers: false
133+
IndentCaseBlocks: false
134+
IndentCaseLabels: true
135+
IndentExternBlock: AfterExternBlock
136+
IndentGotoLabels: true
137+
IndentPPDirectives: None
138+
IndentRequiresClause: true
139+
IndentWidth: 2
140+
IndentWrappedFunctionNames: false
141+
InsertBraces: false
142+
InsertNewlineAtEOF: false
143+
InsertTrailingCommas: None
144+
IntegerLiteralSeparator:
145+
Binary: 0
146+
BinaryMinDigits: 0
147+
Decimal: 0
148+
DecimalMinDigits: 0
149+
Hex: 0
150+
HexMinDigits: 0
151+
JavaScriptQuotes: Leave
152+
JavaScriptWrapImports: true
153+
KeepEmptyLinesAtTheStartOfBlocks: true
154+
KeepEmptyLinesAtEOF: false
155+
LambdaBodyIndentation: Signature
156+
LineEnding: DeriveLF
157+
MacroBlockBegin: ''
158+
MacroBlockEnd: ''
159+
MaxEmptyLinesToKeep: 1
160+
NamespaceIndentation: None
161+
ObjCBinPackProtocolList: Auto
162+
ObjCBlockIndentWidth: 2
163+
ObjCBreakBeforeNestedBlockParam: true
164+
ObjCSpaceAfterProperty: true
165+
ObjCSpaceBeforeProtocolList: false
166+
PackConstructorInitializers: BinPack
167+
PenaltyBreakAssignment: 2
168+
PenaltyBreakBeforeFirstCallParameter: 19
169+
PenaltyBreakComment: 300
170+
PenaltyBreakFirstLessLess: 120
171+
PenaltyBreakOpenParenthesis: 0
172+
PenaltyBreakScopeResolution: 500
173+
PenaltyBreakString: 1000
174+
PenaltyBreakTemplateDeclaration: 10
175+
PenaltyExcessCharacter: 1000000
176+
PenaltyIndentedWhitespace: 0
177+
PenaltyReturnTypeOnItsOwnLine: 200
178+
PointerAlignment: Left
179+
PPIndentWidth: -1
180+
QualifierAlignment: Leave
181+
ReferenceAlignment: Pointer
182+
ReflowComments: true
183+
RemoveBracesLLVM: false
184+
RemoveParentheses: Leave
185+
RemoveSemicolon: false
186+
RequiresClausePosition: OwnLine
187+
RequiresExpressionIndentation: OuterScope
188+
SeparateDefinitionBlocks: Leave
189+
ShortNamespaceLines: 1
190+
SkipMacroDefinitionBody: false
191+
SortIncludes: CaseSensitive
192+
SortJavaStaticImport: Before
193+
SortUsingDeclarations: LexicographicNumeric
194+
SpaceAfterCStyleCast: false
195+
SpaceAfterLogicalNot: false
196+
SpaceAfterTemplateKeyword: false
197+
SpaceAroundPointerQualifiers: Default
198+
SpaceBeforeAssignmentOperators: true
199+
SpaceBeforeCaseColon: false
200+
SpaceBeforeCpp11BracedList: false
201+
SpaceBeforeCtorInitializerColon: true
202+
SpaceBeforeInheritanceColon: true
203+
SpaceBeforeJsonColon: false
204+
SpaceBeforeParens: ControlStatements
205+
SpaceBeforeParensOptions:
206+
AfterControlStatements: true
207+
AfterForeachMacros: true
208+
AfterFunctionDefinitionName: false
209+
AfterFunctionDeclarationName: false
210+
AfterIfMacros: true
211+
AfterOverloadedOperator: false
212+
AfterPlacementOperator: true
213+
AfterRequiresInClause: false
214+
AfterRequiresInExpression: false
215+
BeforeNonEmptyParentheses: false
216+
SpaceBeforeRangeBasedForLoopColon: true
217+
SpaceBeforeSquareBrackets: false
218+
SpaceInEmptyBlock: false
219+
SpacesBeforeTrailingComments: 1
220+
SpacesInAngles: Never
221+
SpacesInContainerLiterals: true
222+
SpacesInLineCommentPrefix:
223+
Minimum: 1
224+
Maximum: -1
225+
SpacesInParens: Never
226+
SpacesInParensOptions:
227+
InCStyleCasts: false
228+
InConditionalStatements: false
229+
InEmptyParentheses: false
230+
Other: false
231+
SpacesInSquareBrackets: false
232+
Standard: Latest
233+
StatementAttributeLikeMacros:
234+
- Q_EMIT
235+
StatementMacros:
236+
- Q_UNUSED
237+
- QT_REQUIRE_VERSION
238+
TabWidth: 8
239+
UseTab: Never
240+
VerilogBreakBetweenInstancePorts: true
241+
WhitespaceSensitiveMacros:
242+
- BOOST_PP_STRINGIZE
243+
- CF_SWIFT_NAME
244+
- NS_SWIFT_NAME
245+
- PP_STRINGIZE
246+
- STRINGIZE
247+
248+
---
249+
# Couchbase Adjustments
3250
Language: Cpp
4-
BasedOnStyle: Mozilla
5251
Standard: c++17
6-
7-
UseTab: Never
8-
IndentWidth: 4
9-
ColumnLimit: 140
252+
IndentWidth: 2
253+
ColumnLimit: 100
10254
AllowShortFunctionsOnASingleLine: None
11-
AllowShortBlocksOnASingleLine: Never
12-
AllowShortCaseLabelsOnASingleLine: false
255+
AllowShortLambdasOnASingleLine: None
256+
AllowShortEnumsOnASingleLine: false
13257
BreakBeforeBraces: Linux
14-
SortIncludes: false
15258
FixNamespaceComments: true

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.2.0
3+
rev: v4.6.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
77
- id: check-yaml
8+
args: [--allow-multiple-documents]
89
- id: check-added-large-files
910
- id: check-toml
1011
- id: check-merge-conflict
1112
- repo: https://github.com/pre-commit/mirrors-clang-format
12-
rev: v13.0.0
13+
rev: v18.1.6
1314
hooks:
1415
- id: clang-format
1516
files: src/.*\.(cxx|hxx)$
1617
exclude: ^deps/
17-
- repo: https://github.com/pre-commit/mirrors-autopep8
18-
rev: v2.0.4
18+
- repo: https://github.com/hhatto/autopep8
19+
rev: v2.2.0
1920
hooks:
2021
- id: autopep8
2122
exclude: ^(deps/|src/)
2223
- repo: https://github.com/pycqa/flake8
23-
rev: 4.0.1
24+
rev: 5.0.4
2425
hooks:
2526
- id: flake8
2627
exclude: |
@@ -39,7 +40,7 @@ repos:
3940
--max-complexity=10
4041
]
4142
- repo: https://github.com/PyCQA/isort
42-
rev: 5.11.5
43+
rev: 5.13.2
4344
hooks:
4445
- id: isort
4546
exclude: |
@@ -58,7 +59,7 @@ repos:
5859
"--order-by-type True"
5960
]
6061
- repo: https://github.com/PyCQA/bandit
61-
rev: 1.7.2
62+
rev: 1.7.9
6263
hooks:
6364
- id: bandit
6465
exclude: |
@@ -68,8 +69,7 @@ repos:
6869
acouchbase/tests/|
6970
txcouchbase/tests/|
7071
couchbase/tests/|
71-
tests/mock_server.py|
72-
tests/environments/|
72+
tests/|
7373
simple_acouchbase.py|
7474
simple_couchbase.py|
7575
simple_txcouchbase.py|

acouchbase/collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def get_any_replica(self,
192192
print(f'Document is replica: {res.is_replica}')
193193
print(f'Document value: {res.content_as[dict]}')
194194
195-
"""
195+
""" # noqa: E501
196196

197197
final_args = forward_args(kwargs, *opts)
198198
transcoder = final_args.get('transcoder', None)

couchbase/collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def get_any_replica(self,
232232
print(f'Document is replica: {res.is_replica}')
233233
print(f'Document value: {res.content_as[dict]}')
234234
235-
"""
235+
""" # noqa: E501
236236

237237
final_args = forward_args(kwargs, *opts)
238238
transcoder = final_args.get('transcoder', None)

0 commit comments

Comments
 (0)