Skip to content

Commit 3bafe16

Browse files
authored
enabled some clang-tidy warnings for non-GUI code (#5679)
There are some clang-tidy warnings which cannot properly handle the extensions used in the Qt code so the produce lots of false positives and were previously enabled. With clang-tidy now offering the possibility to inherit the parent configuration we can enable these across the project and simply disable them for the GUI code. No additional warnings were found as they were already fixed in earlier commits without enabling the checks in question.
1 parent 92c089d commit 3bafe16

4 files changed

Lines changed: 21 additions & 11 deletions

File tree

.clang-tidy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ Checks: >
6161
-readability-braces-around-statements,
6262
-readability-const-return-type,
6363
-readability-container-data-pointer,
64-
-readability-convert-member-functions-to-static,
6564
-readability-function-cognitive-complexity,
6665
-readability-function-size,
6766
-readability-identifier-length,
6867
-readability-identifier-naming,
6968
-readability-implicit-bool-conversion,
7069
-readability-isolate-declaration,
7170
-readability-magic-numbers,
72-
-readability-redundant-access-specifiers,
7371
-readability-suspicious-call-argument,
7472
-readability-uppercase-literal-suffix
7573
WarningsAsErrors: '*'

clang-tidy.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ These might change the behavior of code which might not be intended (need to fil
7171

7272
This leads to a mismatch of raw string literals and regular ones and does reduce the readability.
7373

74-
`readability-convert-member-functions-to-static`<br/>
75-
76-
Disabled because of false positives with Qt `slot` methods (see https://github.com/llvm/llvm-project/issues/57520).
77-
7874
`-clang-analyzer-*`<br/>
7975

8076
Disabled because of false positives (needs to file an upstream bug report).
@@ -112,10 +108,6 @@ Produces a lot of false positives since it is too vague in its analysis.
112108

113109
Produces warnings which might be considered false positives starting with C++11 - see https://github.com/llvm/llvm-project/issues/54526.
114110

115-
`readability-redundant-access-specifiers`<br/>
116-
117-
Reports warning with the Qt `<access-specifier> slots:` syntax in class declarations - see https://github.com/llvm/llvm-project/issues/60055.
118-
119111
`modernize-avoid-c-arrays`<br/>
120112

121113
Produces warnings when `const char[]` is being used which is quite common in our code. Does not make sense to enable before C++17 when `std::string_view` becomes available.
@@ -196,4 +188,14 @@ This is the most expensive check for several files and it is providing much in t
196188

197189
`modernize-use-nullptr`
198190

199-
This is already covered by the `-Wzero-as-null-pointer-constant` compiler warning so there is no need for an additional check.
191+
This is already covered by the `-Wzero-as-null-pointer-constant` compiler warning so there is no need for an additional check.
192+
193+
### Disabled for GUI only
194+
195+
`readability-convert-member-functions-to-static`<br/>
196+
197+
Disabled because of false positives with Qt `slot` methods (see https://github.com/llvm/llvm-project/issues/57520).
198+
199+
`readability-redundant-access-specifiers`<br/>
200+
201+
Reports warning with the Qt `<access-specifier> slots:` syntax in class declarations - see https://github.com/llvm/llvm-project/issues/60055.

gui/.clang-tidy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
Checks: >
3+
-readability-convert-member-functions-to-static,
4+
-readability-redundant-access-specifiers
5+
InheritParentConfig: true

tools/triage/.clang-tidy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
Checks: >
3+
-readability-convert-member-functions-to-static,
4+
-readability-redundant-access-specifiers
5+
InheritParentConfig: true

0 commit comments

Comments
 (0)