-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.clang-tidy
133 lines (128 loc) · 4.86 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# See also: .clang-tidy configs in src/util/ and test/.
# Note that Checks in child configs are additive with the parent config,
# whereas CheckOptions settings override parent config settings of the
# same name.
Checks: >
clang-diagnostic-*,
clang-analyzer-*,
cert-*,
bugprone-*,
performance-*,
portability-*,
readability-*,
misc-*,
android-cloexec-*,
cppcoreguidelines-avoid-non-const-global-variables,
modernize-macro-to-enum,
-clang-diagnostic-pointer-sign,
-clang-diagnostic-sign-compare,
-clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-unix.Malloc,
-clang-analyzer-valist.Uninitialized,
-cert-err33-c,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
-bugprone-sizeof-expression,
-bugprone-switch-missing-default-case,
-readability-avoid-nested-conditional-operator,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-uppercase-literal-suffix,
-performance-no-int-to-ptr,
-misc-include-cleaner,
CheckOptions:
readability-implicit-bool-conversion.AllowIntegerConditions: true
readability-implicit-bool-conversion.AllowPointerConditions: true
readability-simplify-boolean-expr.ChainedConditionalAssignment: true
readability-simplify-boolean-expr.ChainedConditionalReturn: true
readability-function-size.LineThreshold: '250'
readability-function-size.StatementThreshold: '200'
readability-function-size.NestingThreshold: '6'
readability-function-size.ParameterThreshold: '6'
readability-function-size.VariableThreshold: '32'
readability-identifier-naming.ConstantCase: lower_case
readability-identifier-naming.EnumCase: CamelCase
readability-identifier-naming.EnumConstantCase: UPPER_CASE
readability-identifier-naming.EnumConstantIgnoredRegexp: '[a-z]'
readability-identifier-naming.FunctionCase: lower_case
readability-identifier-naming.FunctionIgnoredRegexp: '^xmul_$'
readability-identifier-naming.LocalVariableCase: lower_case
readability-identifier-naming.LocalVariableIgnoredRegexp: '[A-Z]'
readability-identifier-naming.MacroDefinitionCase: aNy_CasE
readability-identifier-naming.MacroDefinitionIgnoredRegexp: '^error_msg(_errno)?_$'
readability-identifier-naming.MemberCase: lower_case
readability-identifier-naming.ParameterCase: lower_case
readability-identifier-naming.ParameterIgnoredRegexp: '[A-Z]'
readability-identifier-naming.StructCase: CamelCase
readability-identifier-naming.StructIgnoredRegexp: '^(cconv|llmap)$'
readability-identifier-naming.TypedefCase: CamelCase
readability-identifier-naming.UnionCase: CamelCase
readability-identifier-naming.VariableCase: lower_case
# Note that this configuration produces warnings like "side effect in
# BUG_ON() condition discarded in release builds", but that message isn't
# actually accurate with our usage. The BUG_ON() condition is never
# discarded and we're simply using this check to restrict function calls
# to a small list that are either known to be eliminated as dead code or
# prevented from running in release builds through some other means (e.g.
# ifdef or early return). See the definition of BUG() for more context.
bugprone-assert-side-effect.AssertMacros: BUG_ON
bugprone-assert-side-effect.CheckFunctionCalls: true
bugprone-assert-side-effect.IgnoredFunctions: >
block_iter_is_bol;
block_iter_is_eof;
buffer_contains_block;
color_is_rgb;
color_is_valid;
cond_type_has_destination;
count_nl;
cursor_color_is_valid;
cursor_type_is_valid;
has_flag;
is_newly_detected_feature;
is_root_frame;
is_valid_filetype_name;
list_empty;
mem_equal;
obuf_avail;
path_is_absolute;
portability-restrict-system-includes.Includes: >
-*,
dirent.h,
errno.h,
fcntl.h,
glob.h,
iconv.h,
inttypes.h,
langinfo.h,
limits.h,
locale.h,
poll.h,
regex.h,
signal.h,
stdarg.h,
stdbit.h,
stdbool.h,
stddef.h,
stdint.h,
stdio.h,
stdlib.h,
string.h,
sys/ioctl.h,
sys/mman.h,
sys/stat.h,
sys/types.h,
sys/utsname.h,
sys/wait.h,
termios.h,
time.h,
unistd.h,
sanitizer/asan_interface.h,