-
Notifications
You must be signed in to change notification settings - Fork 18
/
.clang-tidy
105 lines (102 loc) · 3.98 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
#
# 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.
# We disable a number of checks that cause frequent false positives, including:
# -bugprone-unchecked-optional-access treats std::optional::value as "unchecked"
# -misc-include-cleaner can't deal with "interface headers" such as sycl.hpp
# -misc-unused-using-decls complains about "using sub_group = sycl::sub_group" (API export)
# -readability-convert-member-functions-to-static lints against implementations of fmt::formatter
Checks: -*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-lambda-function-name,
-bugprone-macro-parentheses,
-bugprone-unchecked-optional-access,
misc-*,
-misc-include-cleaner,
-misc-misplaced-const,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-misc-unused-using-decls,
-misc-use-anonymous-namespace,
clang-analyzer-*,
-clang-analyzer-optin.mpi.MPI-Checker,
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-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-reinterpret-cast,
mpi-*,
performance-*,
-performance-enum-size,
readability-*,
-readability-avoid-const-params-in-decls,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-qualified-auto,
-readability-redundant-inline-specifier,
-readability-uppercase-literal-suffix,
CheckOptions:
- key: misc-const-correctness.WarnPointersAsValues
value: true
# 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