Skip to content

Commit b04cb66

Browse files
committed
Disable clang-tidy checks that frequently produce false-positives
1 parent 2cfcb69 commit b04cb66

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

.clang-tidy

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,58 @@
1111
# `git diff -U0 --no-color | clang-tidy-diff.py -p1 -path path/to/compile_commands.json`
1212
#
1313
InheritParentConfig: false
14+
1415
# See https://clang.llvm.org/extra/clang-tidy/checks/list.html for a full list of available checks.
15-
# Note: We would like to enable `misc-const-correctness` (introduced with Clang 15), but it currently
16-
# seems to be somewhat buggy still (producing false positives) => revisit at some point.
16+
# We disable a number of checks that cause frequent false positives, including:
17+
# -bugprone-unchecked-optional-access treats std::optional::value as "unchecked"
18+
# -misc-include-cleaner can't deal with "interface headers" such as sycl.hpp
19+
# -misc-unused-using-decls complains about "using sub_group = sycl::sub_group" (API export)
20+
# -readability-convert-member-functions-to-static lints against implementations of fmt::formatter
1721
Checks: -*,
1822
bugprone-*,
1923
-bugprone-easily-swappable-parameters,
2024
-bugprone-lambda-function-name,
2125
-bugprone-macro-parentheses,
26+
-bugprone-unchecked-optional-access,
2227
misc-*,
23-
-misc-const-correctness,
28+
-misc-include-cleaner,
29+
-misc-misplaced-const,
2430
-misc-no-recursion,
2531
-misc-non-private-member-variables-in-classes,
2632
-misc-unused-parameters,
33+
-misc-unused-using-decls,
34+
-misc-use-anonymous-namespace,
2735
clang-analyzer-*,
36+
-clang-analyzer-optin.mpi.MPI-Checker,
2837
clang-diagnostic-*,
2938
cppcoreguidelines-*,
3039
-cppcoreguidelines-avoid-c-arrays,
3140
-cppcoreguidelines-avoid-do-while,
3241
-cppcoreguidelines-avoid-magic-numbers,
3342
-cppcoreguidelines-macro-usage,
3443
-cppcoreguidelines-non-private-member-variables-in-classes,
44+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
45+
-cppcoreguidelines-pro-bounds-constant-array-index,
3546
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
47+
-cppcoreguidelines-pro-type-const-cast,
48+
-cppcoreguidelines-pro-type-reinterpret-cast,
3649
mpi-*,
3750
performance-*,
3851
-performance-enum-size,
3952
readability-*,
4053
-readability-avoid-const-params-in-decls,
54+
-readability-convert-member-functions-to-static,
55+
-readability-else-after-return,
4156
-readability-function-cognitive-complexity,
4257
-readability-identifier-length,
4358
-readability-magic-numbers,
4459
-readability-qualified-auto,
60+
-readability-redundant-inline-specifier,
4561
-readability-uppercase-literal-suffix,
4662

4763
CheckOptions:
64+
- key: misc-const-correctness.WarnPointersAsValues
65+
value: true
4866
# Naming conventions
4967
- key: readability-identifier-naming.ClassCase
5068
value: lower_case

examples/.clang-tidy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
InheritParentConfig: true
3+
4+
# We disable some checks that cause false-positives in examples.
5+
# -misc-const-correctness: Would suggest `const accessor` in CGFs
6+
Checks: -misc-const-correctness

test/.clang-tidy

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
22
InheritParentConfig: true
3+
34
# Disable some checks that cause frequent false-positives in tests
4-
# misc-include-cleaner: Does not understand that celerity.h is the entry point for all public Celerity headers
5-
# misc-use-anonymous-namespace: Catch2 emits static functions for TEST_CASE()
6-
# bugprone-chained-comparison: Catch2 uses a comparison operator overloading hack to decompose expressions
7-
Checks: -readability-function-cognitive-complexity,
5+
# -misc-const-correctness: Would suggest `const accessor` in CGFs
6+
# -misc-include-cleaner: Does not understand that celerity.h is the entry point for all public Celerity headers
7+
# -misc-use-anonymous-namespace: Catch2 emits static functions for TEST_CASE()
8+
# -bugprone-chained-comparison: Catch2 uses a comparison operator overloading hack to decompose expressions
9+
Checks: -misc-const-correctness,
10+
-readability-function-cognitive-complexity,
11+
-cppcoreguidelines-avoid-do-while,
812
-cppcoreguidelines-avoid-non-const-global-variables,
9-
-misc-include-cleaner,
10-
-misc-use-anonymous-namespace,
11-
-bugprone-chained-comparison,
13+
-bugprone-chained-comparison

0 commit comments

Comments
 (0)