-
Notifications
You must be signed in to change notification settings - Fork 18
/
.clang-tidy
86 lines (84 loc) · 3.18 KB
/
.clang-tidy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
#
# Clang-Tidy configuration for Celerity.
#
# There are three usage scenarios:
# 1. Automatic checks through an IDE (CLion, VsCode, ...)
# 2. Running manually on select files (not recommended)
# `clang-tidy -p path/to/compile_commands.json file1 [file2, ...]`
# Note: A script for running clang-tidy on all Celerity sources is provided in `ci/run-clang-tidy.sh`
# 3. Running on a diff (also done during CI)
# `git diff -U0 --no-color | clang-tidy-diff.py -p1 -path path/to/compile_commands.json`
#
InheritParentConfig: false
# See https://clang.llvm.org/extra/clang-tidy/checks/list.html for a full list of available checks.
# Note: We would like to enable `misc-const-correctness` (introduced with Clang 15), but it currently
# seems to be somewhat buggy still (producing false positives) => revisit at some point.
Checks: -*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-lambda-function-name,
-bugprone-macro-parentheses,
misc-*,
-misc-const-correctness,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
clang-analyzer-*,
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
mpi-*,
performance-*,
readability-*,
-readability-avoid-const-params-in-decls,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-qualified-auto,
-readability-uppercase-literal-suffix,
CheckOptions:
# Naming conventions
- key: readability-identifier-naming.ClassCase
value: lower_case
- key: readability-identifier-naming.ClassMethodCase
value: lower_case
- key: readability-identifier-naming.EnumCase
value: lower_case
- key: readability-identifier-naming.EnumConstantCase
value: lower_case
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.LocalVariableIgnoredRegexp
# Allow single-letter uppercase variable names
value: "[A-Z]"
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.ParameterIgnoredRegexp
# Allow single-letter uppercase function parameters
value: "[A-Z]"
- key: readability-identifier-naming.ProtectedMemberCase
value: lower_case
- key: readability-identifier-naming.ProtectedMemberPrefix
value: m_
- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberPrefix
value: m_
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
# Other coding conventions
- key: readability-braces-around-statements.ShortStatementLines
# Allow control-flow statements w/o braces when on a single line
value: 1
# Treat naming violations as errors
WarningsAsErrors: "readability-identifier-naming"
# Use .clang-format configuration for fixes
FormatStyle: file