-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.clang-tidy
74 lines (60 loc) · 2.54 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
# Include headers in directories 'include', 'src', 'printer' and 'test'
# The (/[^./][^/]*)+ matches all reasonable header/directory names, but does not
# match '..', so e.g. 'xxx/src/../lib/yyy.h' won't match
# Note: do not indent - this will break the regex
HeaderFilterRegex: "/(include|src|printer|test)(/[^./][^/]*)+$"
Checks: "-*,\
clang-analyzer-*,\
cppcoreguidelines-*,\
modernize-*,\
performance-*,\
readability-*,\
clang-diagnostic-*,\
-modernize-use-trailing-return-type,\
-cppcoreguidelines-pro-bounds-constant-array-index,\
-*-avoid-c-arrays,\
-readability-else-after-return,\
-readability-named-parameter,\
-readability-use-anyofallof,\
-cppcoreguidelines-pro-bounds-pointer-arithmetic,\
-performance-trivially-destructible,\
-modernize-make-unique,\
-cppcoreguidelines-prefer-member-initializer,\
-*-magic-numbers,\
-readability-suspicious-call-argument"
# modernize-use-trailing-return-type
# ignore reason: reduces readability
# cppcoreguidelines-pro-bounds-constant-array-index
# ignore reason: infeasible to avoid without GSL
# *-avoid-c-arrays
# ignore reason: often makes code significantly more verbose
# readability-else-after-return
# ignore reason: personal preference of OLEGSHA (using 'else' helps highlight
# branches in code)
# readability-named-parameter
# ignore reason: using GCC convention is clear enough
# readability-use-anyofallof
# ignore reason: these relatively obscure functions reduce readability by
# increasing code complexity and verbosity
# cppcoreguidelines-pro-bounds-pointer-arithmetic
# ignore reason: infeasible to avoid in C++17
# performance-trivially-destructible
# ignore reason: breaks incapsulation too often
# modernize-make-unique
# ignore reason: impossible with brace-init lists:
# struct S { int a; int b; };
# std::unique_ptr<S>(new S { 1, 2 }) // works
# std::make_unique<S>(1, 2) // error
# std::make_unique<S>({1, 2}) // error
# cppcoreguidelines-prefer-member-initializer
# ignore reason: rule fails to notice execution order dependencies
# *-magic-numbers
# ignore reason: triggers in many trivial cases (e.g. 6 sides of a cube);
# infeasible to avoid while writing placeholder code
# readability-suspicious-call-argument
# ignore reason: trips up on geometry code (y no NOLINTBEGIN, Debian?)
CheckOptions:
# Change reason: highlighted as acceptable (and, in maintainer's opinion,
# reasonable) by C++ Core Guidelines C.21
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: 'true'