-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.clang-tidy
97 lines (95 loc) · 3.38 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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Part of BlueTit Solver, licensed under Apache 2.0 with Commons Clause.
# Commercial use, including SaaS, requires a separate license, see /LICENSE.md
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Enable almost all non-vendor-specific checks.
#
# Rational on disabled checks:
#
# * bugprone-easily-swappable-parameters:
# There are many easily-swappable parameters in the solver code, we cannot
# avoid that without introducing structures almost for any function.
#
# * cert-dcl58-cpp:
# This checks threats specializations of `std::` classes as modifying the
# standard library.
#
# * cert-msc32-c, cert-msc51-cpp:
# Those are crypography-related. We are not doing anything that requires
# any level of sequerity right now.
#
# * clang-analyzer-optin.core.EnumCastOutOfRange:
# To be re-enabled in the future, once there is a better support for flag
# enums.
#
# * cppcoreguidelines-avoid-do-while:
# Doctest uses do-while loops in it's assert macros. Apart from that, the
# check is definitely useful.
#
# * cppcoreguidelines-avoid-magic-numbers, readability-magic-numbers:
# We have a few, I would like to re-enable this check in the future.
#
# * cppcoreguidelines-avoid-non-const-global-variables
# We have a few of those, and I do not want to wrap them into `// NOLINT`
# everytime. Also this check does not recognize `thread_local` variables,
# that are also considered global.
#
# * cppcoreguidelines-macro-usage:
# Macros are part of the language, I am not feeling bad about using them.
#
# * cppcoreguidelines-pro-bounds-constant-array-index:
# This check does not works correctly with our asserts.
#
# * misc-no-recursion:
# We need recusion is some in templated recurred lambdas.
#
# * modernize-use-nodiscard:
# I do not want to put `[[nodiscard]]` everywhere, especially on functions
# like `size()`. I want to use `[[nodiscard]]` only when it is really needed,
# like memory allocation functions or system calls.
#
# * modernize-type-traits:
# Several libraries use C++11 type traits in their macros (doctest, Crow).
#
# * readability-braces-around-statements:
# I do not like braces around short single-line statements.
#
# * readability-function-cognitive-complexity:
# This check does not works correctly with doctest macros.
#
# * readability-identifier-length:
# We have a lot of short identifiers, since we are doing a lot of math.
#
# * readability-math-missing-parentheses:
# I do not like to put parentheses around everything, especially when we have
# a lot of math.
Checks: |
bugprone-*
-bugprone-easily-swappable-parameters
cert-*
-cert-dcl58-cpp
-cert-msc32-c
-cert-msc51-cpp
-clang-analyzer-optin.core.EnumCastOutOfRange
concurrency-*
cppcoreguidelines-*
-cppcoreguidelines-avoid-do-while
-cppcoreguidelines-avoid-magic-numbers
-cppcoreguidelines-avoid-non-const-global-variables
-cppcoreguidelines-macro-usage
-cppcoreguidelines-pro-bounds-constant-array-index
misc-*
-misc-no-recursion
modernize-*
-modernize-use-nodiscard
-modernize-type-traits
performance-*
readability-*
-readability-braces-around-statements
-readability-function-cognitive-complexity
-readability-identifier-length
-readability-magic-numbers
-readability-math-missing-parentheses
# Treat all warning as errors.
WarningsAsErrors: |
*