forked from haveneer/cpp-advanced-training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-tidy
50 lines (46 loc) · 2.32 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
# clang-tidy -dump-config : displays current config
# clang -help : provides help about .clang-tidy config file
Checks: "\
*,\
-llvm-header-guard,\
-google-build-using-namespace,\
-clang-analyzer-alpha.clone.CloneChecker,\
-google-runtime-int,\
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,\
-clang-analyzer-alpha.deadcode.UnreachableCode,\
-misc-use-after-move,\
-cppcoreguidelines-pro-type-vararg,\
-modernize-use-emplace,\
-cert-err60-cpp,\
-modernize-use-trailing-return-type,\
-fuchsia-default-arguments-calls,\
-modernize-use-nodiscard,\
-readability-*, -*-readability-*,\
-cppcoreguidelines-avoid-magic-numbers,\
-modernize-use-override, -modernize-loop-convert,\
-clang-diagnostic-unused-variable,\
-hicpp-use-auto, -modernize-use-auto,\
-llvm-include-order,\
-hicpp-braces-around-statements,\
-clang-diagnostic-error,\
-llvmlibc-*"
# All checkers turned on, minus:
# * Proper header guards used (the check is very brittle and incorrectly assesses my guards)
# * Use of "using namespace" (the check fires even on non-global using namespace, which is daft)
# * Copy and paste detection (the check fires on unit test code which is by its nature very copy and paste)
# * Use of traditional integral types
# * Array to pointer decay (the check fires on static constexpr string arrays, daft)
# * Unreachable code (the check is too naive and misses CRTP injected code)
# * Use after move (my unit tests test semantics when you do this, most shouldn't need to disable this)
# * Use of printf
# * Use of push_back instead of emplace (unhelpful check, emplace isn't exception safe like push_back)
# * Throwing exception objects which aren't nothrow copy constructible (Dinkumware STL does this, not my fault)
# * modernize function style to C++11 trailing return type
# * disallow usage of implicit optional arguments in calls
# * remove "method must resolve to a function within the __llvm_libc namespace" warnings
# Like in https://github.com/Kitware/CMake/blob/master/.clang-tidy
# pattern should be filtered as `find | grep -E PATTERN` do
# Unfortunately, I did'nt succeed to enable it and filter out armadillo headers
HeaderFilterRegex: 'src/lib/.*\.(hpp|cpp)$'
#CheckOptions:
WarningsAsErrors: bugprone-use-after-move, hicpp-invalid-access-moved, hicpp-move-const-arg, performance-move-const-arg