Skip to content

Commit b7133a3

Browse files
committed
Adding clangd]clang-tidy files
1 parent 18d7d20 commit b7133a3

2 files changed

Lines changed: 132 additions & 0 deletions

File tree

.clang-tidy

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
Checks: >
2+
-clang-analyzer-core.NonNullParamChecker,
3+
-clang-analyzer-optin.cplusplus.UninitializedObject,
4+
abseil-duration-*,
5+
abseil-faster-strsplit-delimiter,
6+
abseil-no-namespace,
7+
abseil-redundant-strcat-calls,
8+
abseil-str-cat-append,
9+
abseil-string-find-startswith,
10+
abseil-upgrade-duration-conversions,
11+
bugprone-assert-side-effect,
12+
bugprone-unused-raii,
13+
bugprone-use-after-move,
14+
clang-analyzer-core.DivideZero,
15+
misc-unused-using-decls,
16+
modernize-deprecated-headers,
17+
modernize-loop-convert,
18+
modernize-make-shared,
19+
modernize-make-unique,
20+
# modernize-return-braced-init-list,
21+
modernize-use-default-member-init,
22+
modernize-use-equals-default,
23+
modernize-use-nullptr,
24+
modernize-use-override,
25+
modernize-use-using,
26+
performance-faster-string-find,
27+
performance-for-range-copy,
28+
performance-inefficient-algorithm,
29+
performance-inefficient-vector-operation,
30+
performance-noexcept-move-constructor,
31+
performance-move-constructor-init,
32+
performance-type-promotion-in-math-fn,
33+
performance-unnecessary-copy-initialization,
34+
readability-container-size-empty,
35+
readability-identifier-naming,
36+
readability-redundant-control-flow,
37+
readability-redundant-member-init,
38+
readability-redundant-smartptr-get,
39+
readability-redundant-string-cstr
40+
41+
CheckOptions:
42+
- key: cppcoreguidelines-unused-variable.IgnorePattern
43+
value: "^_$"
44+
- key: bugprone-assert-side-effect.AssertMacros
45+
value: 'ASSERT'
46+
- key: bugprone-dangling-handle.HandleClasses
47+
value: 'std::basic_string_view;std::experimental::basic_string_view;absl::string_view'
48+
- key: modernize-use-auto.MinTypeNameLength
49+
value: '10'
50+
- key: readability-identifier-naming.ClassCase
51+
value: 'lower_case'
52+
- key: readability-identifier-naming.EnumCase
53+
value: 'CamelCase'
54+
- key: readability-identifier-naming.EnumConstantCase
55+
value: 'lower_case'
56+
# Ignore GoogleTest function macros.
57+
- key: readability-identifier-naming.FunctionIgnoredRegexp
58+
# To have the regex chomped correctly fence all items with `|` (other than first/last)
59+
value: >-
60+
(^AbslHashValue$|
61+
|^called_count$|
62+
|^case_sensitive$|
63+
|^Create$|
64+
|^envoy_resolve_dns$|
65+
|^evconnlistener_free$|
66+
|^event_base_free$|
67+
|^(get|set)EVP_PKEY$|
68+
|^has_value$|
69+
|^Ip6(ntohl|htonl)$|
70+
|^get_$|
71+
|^HeaderHasValue(Ref)?$|
72+
|^HeaderValueOf$|
73+
|^Is(Superset|Subset)OfHeaders$|
74+
|^LLVMFuzzerInitialize$|
75+
|^LLVMFuzzerTestOneInput$|
76+
|^Locality$|
77+
|^MOCK_METHOD$|
78+
|^PrepareCall$|
79+
|^PrintTo$|
80+
|^resolve_dns$|
81+
|^result_type$|
82+
|Returns(Default)?WorkerId$|
83+
|^sched_getaffinity$|
84+
|^shutdownThread_$|
85+
|TEST|
86+
|^use_count$)
87+
- key: readability-identifier-naming.VariableCase
88+
value: 'lower_case'
89+
- key: readability-identifier-naming.ClassCase
90+
value: 'CamelCase'
91+
- key: readability-identifier-naming.ParameterCase
92+
value: 'lower_case'
93+
- key: readability-identifier-naming.ParameterIgnoredRegexp
94+
value: >-
95+
(^cname_ttl_$|
96+
|^_.*$|
97+
|^.*limitK$|
98+
|^.*limitM$)
99+
- key: readability-identifier-naming.PrivateMemberCase
100+
value: 'lower_case'
101+
# - key: readability-identifier-naming.PrivateMemberSuffix
102+
# value: '_'
103+
- key: readability-identifier-naming.StructCase
104+
value: 'CamelCase'
105+
- key: readability-identifier-naming.TypeAliasCase
106+
value: 'lower_case'
107+
- key: readability-identifier-naming.TypeAliasIgnoredRegexp
108+
value: '(result_type)'
109+
- key: readability-identifier-naming.UnionCase
110+
value: 'CamelCase'
111+
- key: readability-identifier-naming.FunctionCase
112+
value: 'lower_case'
113+
- key: readability-identifier-naming.FunctionIgnoredRegexp
114+
value: >-
115+
(^.*nVars.*$|
116+
|^.*limitK$|
117+
|^.*limitM$)
118+
119+
HeaderFilterRegex: '^./source/.*|^./contrib/.*|^./test/.*|^./envoy/.*'
120+
121+
UseColor: true
122+
123+
WarningsAsErrors: ''
124+
125+
## The version here is arbitrary since any change to this file will
126+
## trigger a full run of clang-tidy against all files.
127+
## It can be useful as it seems some header changes may not trigger the
128+
## expected rerun.
129+
# v0

.clangd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CompileFlags: # Tweak the parse settings
2+
Add: [-xc++, -Wall] # treat all files as C++, enable more warnings
3+
Compiler: clang++ # Change argv[0] of compile flags to `clang++`

0 commit comments

Comments
 (0)