Skip to content

Commit dcec961

Browse files
committed
Refactor lint and formatting
1 parent 2acc2bc commit dcec961

File tree

2 files changed

+28
-56
lines changed

2 files changed

+28
-56
lines changed

.clang-format

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
1-
# .clang-format — Based on the Google C++ Style Guide
2-
31
BasedOnStyle: Google
42

5-
# Indentation & wrapping
3+
# Tab vs spaces
4+
UseTab: Never
65
IndentWidth: 2
76
TabWidth: 2
8-
UseTab: Never
7+
8+
AccessModifierOffset: -2
9+
10+
# Column limit
911
ColumnLimit: 120
1012

11-
# Brace and paren placement
13+
# Brace placement
1214
BreakBeforeBraces: Attach
15+
AllowShortFunctionsOnASingleLine: Empty
16+
17+
# Spaces
1318
SpaceBeforeParens: ControlStatements
19+
SpacesInAngles: false
1420

15-
# Pointer alignment
21+
# Pointer/reference alignment
1622
PointerAlignment: Right
1723
DerivePointerAlignment: false
1824

1925
# Includes
2026
SortIncludes: true
2127
IncludeBlocks: Regroup
2228

23-
# Alignment tweaks
24-
AlignConsecutiveDeclarations: true
25-
AlignConsecutiveAssignments: true
26-
27-
# Disable column-alignment of trailing comments
29+
# Alignments
30+
AlignConsecutiveDeclarations: false
31+
AlignConsecutiveAssignments: false
2832
AlignTrailingComments: false
2933

30-
# Allow short inline functions on one line
31-
AllowShortFunctionsOnASingleLine: Inline
34+
# Empty lines
35+
MaxEmptyLinesToKeep: 1
3236

33-
# Trailing comments
34-
SpacesBeforeTrailingComments: 2
37+
# Keep your own short deviations
38+
AllowShortIfStatementsOnASingleLine: false
3539

36-
# Maximum empty lines
37-
MaxEmptyLinesToKeep: 1
40+
BreakConstructorInitializers: AfterColon
41+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
42+
ReflowComments: false

.clang-tidy

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,14 @@
11
Checks: >
22
google-*,
3-
bugprone-*,
4-
clang-analyzer-*,
5-
clang-analyzer-security.*,
6-
cppcoreguidelines-*,
7-
performance-*,
8-
readability-*,
93
modernize-*,
4+
readability-*,
5+
performance-*,
106
-google-build-using-namespace,
117
-google-readability-function-size,
128
-modernize-use-trailing-return-type,
13-
-cppcoreguidelines-pro-type-vararg,
14-
-cppcoreguidelines-owning-memory
9+
-readability-implicit-bool-conversion
1510
16-
UseColor: true
17-
FormatStyle: file
18-
WarningsAsErrors: '*'
11+
WarningsAsErrors: ''
1912

20-
CheckOptions:
21-
# Naming conventions (match .clang-format indent/specs)
22-
- key: readability-identifier-naming.VariableCase
23-
value: lower_case
24-
- key: readability-identifier-naming.FunctionCase
25-
value: camelBack
26-
- key: readability-identifier-naming.ClassCase
27-
value: CamelCase
28-
- key: readability-identifier-naming.ConstantCase
29-
value: UPPER_CASE
30-
- key: readability-identifier-naming.MemberCase
31-
value: lower_case
32-
- key: readability-identifier-naming.PrivateMemberPrefix
33-
value: "m_"
34-
35-
# Modernize
36-
- key: modernize-use-nullptr.NullMacros
37-
value: 'NULL'
38-
- key: modernize-use-using.CheckAliases
39-
value: 'true'
40-
41-
# Performance
42-
- key: performance-unnecessary-value-param.AllowedTypes
43-
value: 'std::string,std::vector'
44-
45-
# Readability
46-
- key: readability-braces-around-statements.ShortStatementLines
47-
value: '1'
13+
FormatStyle: file
14+
UseColor: true

0 commit comments

Comments
 (0)