Skip to content

Commit 1694a7e

Browse files
committed
make: Updating clang-tidy configuration
Updating clang-tidy config for newer features supported. Some of these we will revisit after some code refactoring and if we decide to modernize to C11 as a minimum standard. Signed-off-by: Tyler Erickson <[email protected]>
1 parent 5c3aa02 commit 1694a7e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.clang-tidy

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
Checks:
22
'-*,
33
modernize-*,
4+
-modernize-macro-to-enum,
45
cert-*,
56
bugprone-*,
67
-bugprone-easily-swappable-parameters,
8+
-bugprone-assignment-in-if-condition,
79
clang-analyzer-*,
810
-clang-analyzer-deadcode.DeadStores,
911
misc-*,
1012
-misc-no-recursion,
1113
-misc-unused-parameters,
14+
-misc-include-cleaner,
1215
readability-non-const-parameter,
1316
readability-inconsistent-declaration-parameter-name,
1417
readability-redundant-control-flow,
1518
readability-duplicate-include,
1619
readability-avoid-const-params-in-decls,
1720
readability-function-cognitive-complexity'
1821

22+
# Setting cognitive complexity to 100.
23+
# This is quite high, but should be seen as a starting point
24+
# to resolve other complex functions over time to get back to the default
25+
# value of 25
26+
CheckOptions:
27+
- key: readability-function-cognitive-complexity.Threshold
28+
value: 100
29+
30+
1931
# Other available checks:
2032
# clang-analyzer-*, performance-*, readability-*, misc-*
2133

@@ -29,10 +41,17 @@ Checks:
2941
# Recursion is useful in our code, so this check is not applicable.
3042
# - misc-unused-parameters:
3143
# Too many false positives.
44+
# - misc-include-cleaner
45+
# We have a lot of includes wrapping others to work around system differences. This creates too much noise
46+
# when it is enabled.
47+
# - modernize-macro-to-enum
48+
# This is a great modernization, however it does not make sense everywhere.
49+
# There are plenty of places to use this, however since we do not want to migrate to C11 as a requirement
50+
# yet, this is not something we want to enable due to noise since anonymous enums are a C11 standard and not earlier.
51+
# if/when we require C11, we should enable this
3252
# - readability-*:
3353
# Currently generates too many warnings. Manually adding rules until we can address these issues later.
3454

3555
WarningsAsErrors: ''
3656
HeaderFilterRegex: '.*'
37-
AnalyzeTemporaryDtors: false
3857
FormatStyle: 'file'

0 commit comments

Comments
 (0)