-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy path.clang-tidy
More file actions
118 lines (113 loc) · 4.24 KB
/
Copy path.clang-tidy
File metadata and controls
118 lines (113 loc) · 4.24 KB
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
# Velox enables an explicit allowlist of clang-tidy checks rather than turning on
# the full upstream set. The checks below are the ones that reliably catch real
# bugs, performance problems, and style violations in this codebase. Checks that
# are noisy, conflict with Velox's coding style, or flag patterns that are
# intentional here are deliberately left out -- enabling everything produces far
# more noise than signal.
#
# The clang static analyzer (clang-analyzer-*) is enabled by default, but it is
# explicitly disabled here: it is slow to run and its findings are largely noise
# for this codebase.
#
# readability-identifier-naming enforces the naming rules documented in
# CODING_STYLE.md.
#
# Inherit checks from a parent .clang-tidy if one exists (there is none at the
# repository root).
InheritParentConfig: true
Checks: '
-clang-analyzer-*,
bugprone-argument-comment,
bugprone-sizeof-*,
bugprone-use-after-move,
clang-diagnostic-*,
-clang-diagnostic-nrvo,
-clang-diagnostic-missing-designated-field-initializers,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-special-member-functions,
google-build-using-namespace,
misc-definitions-in-headers,
modernize-use-emplace,
modernize-use-nullptr,
modernize-use-using,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-no-automatic-move,
performance-no-int-to-ptr,
performance-noexcept-move-constructor,
performance-trivially-destructible,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
readability-braces-around-statements,
readability-identifier-naming,
readability-operators-representation,
readability-redundant-string-init,
'
HeaderFilterRegex: '.*'
WarningsAsErrors: 'bugprone-use-after-move'
CheckOptions:
# Naming conventions as explicitly stated in CODING_STYLE.md.
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.ProtectedMemberCase
value: camelBack
- key: readability-identifier-naming.ProtectedMemberSuffix
value: _
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.StaticConstantPrefix
value: k
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k
# Use nullptr instead of NULL or 0.
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
# Tuning options for the checks enabled above.
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: true
- key: cppcoreguidelines-special-member-functions.AllowImplicitlyDeletedCopyOrMove
value: 1
- key: modernize-use-using.IgnoreExternC
value: true
- key: modernize-use-using.IgnoreUsingStdAllocator
value: 1
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false
- key: performance-unnecessary-value-param.AllowedTypes
value: '[Pp]ointer$;[Pp]tr$;[Rr]ef(erence)?$'
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: '[Pp]ointer$;[Pp]tr$;[Rr]ef(erence)?$'
- key: readability-operators-representation.BinaryOperators
value: '&&;&=;&;|;~;!;!=;||;|=;^;^='
- key: readability-redundant-string-init.StringNames
value: '::std::basic_string'