Skip to content

Commit da5e9af

Browse files
author
MarkusB
committed
add clang-tidy config
1 parent be6f2ca commit da5e9af

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

.clang-tidy

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Note, you can't have comments below in a '>' section, that's why here are the comments upfront.
2+
# -hicpp-deprecated-headers: unfortunately, should be restrictable to <>-includes
3+
# -readability-function-cognitive-complexity: goes bogus in gtests unfortunately
4+
# -cppcoreguidelines-pro-type-member-init: buggy unfortunately
5+
6+
Checks: >
7+
*,
8+
-altera-id-dependent-backward-branch,
9+
-altera-struct-pack-align,
10+
-altera-unroll-loops,
11+
-bugprone-easily-swappable-parameters,
12+
-bugprone-empty-catch,
13+
-cert-dcl16-c,
14+
-cert-dcl21-cpp,
15+
-clang-analyzer-deadcode,
16+
-clang-diagnostic-c++17-attribute-extensions,
17+
-clang-diagnostic-c++17-extensions,
18+
-clang-diagnostic-error,
19+
-clang-diagnostic-unused-macros,
20+
-cppcoreguidelines-avoid-do-while,
21+
-cppcoreguidelines-macro-usage,
22+
-cppcoreguidelines-non-private-member-variables-in-classes,
23+
-cppcoreguidelines-owning-memory,
24+
-cppcoreguidelines-pro-type-member-init,
25+
-cppcoreguidelines-pro-type-reinterpret-cast,
26+
-cppcoreguidelines-special-member-functions,
27+
-fuchsia-default-arguments-calls,
28+
-fuchsia-default-arguments-declarations,
29+
-fuchsia-overloaded-operator,
30+
-fuchsia-trailing-return,
31+
-google-explicit-constructor,
32+
-google-readability-avoid-underscore-in-googletest-name,
33+
-google-readability-braces-around-statements,
34+
-hicpp-braces-around-statements,readability-braces-around-statements,
35+
-hicpp-deprecated-headers,
36+
-hicpp-explicit-conversions,
37+
-hicpp-member-init,
38+
-hicpp-named-parameter,
39+
-hicpp-special-member-functions,
40+
-hicpp-uppercase-literal-suffix,
41+
-llvmlibc-callee-namespace,
42+
-llvmlibc-implementation-in-namespace,
43+
-llvmlibc-inline-function-decl,
44+
-llvm-include-order,
45+
-llvmlibc-restrict-system-libc-headers,
46+
-llvm-header-guard,
47+
-misc-no-recursion,
48+
-misc-non-private-member-variables-in-classes,
49+
-modernize-deprecated-headers,
50+
-modernize-use-trailing-return-type,
51+
-readability-braces-around-statements,
52+
-readability-identifier-length,
53+
readability-identifier-naming,
54+
-readability-implicit-bool-conversion,
55+
-readability-inconsistent-ifelse-braces,
56+
-readability-function-cognitive-complexity,
57+
-readability-named-parameter,
58+
-readability-redundant-typename,
59+
-readability-uppercase-literal-suffix
60+
61+
WarningsAsErrors: "*"
62+
63+
CheckOptions:
64+
- { key: readability-identifier-naming.AggressiveDependentMemberLookup, value: true }
65+
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
66+
- { key: readability-identifier-naming.ConceptCase, value: CamelCase }
67+
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
68+
- { key: readability-identifier-naming.EnumConstantCase, value: lower_case }
69+
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
70+
- { key: readability-identifier-naming.FunctionIgnoredRegexp, value: '([_A-Z0-9]+|BM_.*)' }
71+
- { key: readability-identifier-naming.LocalVariableCase, value: lower_case }
72+
- { key: readability-identifier-naming.LocalVariableIgnoredRegexp, value: '(_.*|.*_)' }
73+
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
74+
- { key: readability-identifier-naming.MemberCase, value: lower_case }
75+
- { key: readability-identifier-naming.MethodCase, value: lower_case }
76+
- { key: readability-identifier-naming.MethodIgnoredRegexp, value: '([_A-Z0-9]+|SetUp|TearDown|do_.*)' }
77+
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
78+
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
79+
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case }
80+
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
81+
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
82+
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
83+
- { key: readability-identifier-naming.StructCase, value: CamelCase }
84+
- { key: readability-identifier-naming.TypeAliasCase, value: CamelCase }
85+
- { key: readability-identifier-naming.TypedefCase, value: CamelCase }
86+
- { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase }
87+
- { key: readability-identifier-naming.UnionCase, value: CamelCase }
88+
- { key: readability-identifier-naming.ValueTemplateParameterCase, value: lower_case }
89+
- { key: readability-identifier-naming.VariableCase, value: lower_case }
90+
91+
# Dangerous but needed, over exhaustive, changes also all your included third-party files in build folders.
92+
# Solution (partial perhaps) shown below but not yet usable, unfortunately. So after the run you need to revert or
93+
# delete third-party files.
94+
HeaderFilterRegex: '.*'
95+
# negative look ahead not yet supported
96+
#HeaderFilterRegex: "^.*(?:_deps).*"

0 commit comments

Comments
 (0)