Skip to content

Commit ca7ace2

Browse files
committed
Update .clang-tidy for clang-tidy 22.1.2
1 parent 27bc47a commit ca7ace2

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

.clang-tidy

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
# Reasons
2+
# -------
3+
# A list of common reasons why certain specific lines are not linted (see source code)
4+
#
5+
# Reason 1
6+
# This specific struct/define can be found buried under several stdlib/OS-dependent
7+
# layers of header files, and it triggers the misc-include-cleaner check.
8+
# The misc-include-cleaner check is useful and we don't want to disable it,
9+
# but also including the specific header is cumbersome and not portable.
10+
11+
12+
# Checks
13+
# ------
114
# altera-id-dependent-backward-branch: it's ok to have ID-dependent loops, we have plenty of processing power and no safety critical system
215
# altera-struct-pack-align: it's just for performance, we don't need to optimize up to this level
316
# altera-unroll-loop: it's just for performance, we don't need to optimize up to this level
417
# bugprone-easily-swappable-parameters: loud warnings, with no clear advice on how to fix
18+
# llvm-header-guard: warns when headers do not adhere to LLVM style, but this is not LLVM
519
# llvmlibc-restrict-system-libc-headers: this is a desktop application, libc is useful
620
# cppcoreguidelines*: this is a C application, not a C++ one
721
# readability-magic-numbers.IgnorePowersOf2IntegerValues: it's reasonable that powers of two can be pretty self-explanatory in an emulator
@@ -11,15 +25,19 @@
1125
# concurrency-mt-unsafe: better to check for errors with strerror() and errno, instead of ignoring because functions are thread unsafe, don't you think?
1226
# clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling: disabled because everybody needs memset()
1327
# modernize-macro-to-enum: too much noise for harmless notation
28+
# readability-avoid-unconditional-preprocessor-if: this is the only proper way to leave some stale, but useful code in the codebase, we can't have clang-tidy prohibit it
29+
# readability-implicit-bool-conversion: explicit bool/int generates a lot of unnecessary boilerplate which actually impairs readability at this point
1430
# readability-function-cognitive-complexity: difficult to decide a meaningful threshold, this has been chosen pretty random
1531
# readability-magic-numbers: this is an emulator, we need magic numbers here and there, otherwise code will get too bloated
32+
# readability-use-concise-preprocessor-directives: they were expanded because clang-tidy asked us to do so in a previous version, so it better shut up now
1633

1734
Checks: >
1835
*,
1936
-altera-id-dependent-backward-branch,
2037
-altera-struct-pack-align,
2138
-altera-unroll-loops,
2239
-bugprone-easily-swappable-parameters,
40+
-llvm-header-guard,
2341
-llvmlibc-restrict-system-libc-headers,
2442
-cppcoreguidelines*,
2543
-google-readability-braces-around-statements,
@@ -30,7 +48,10 @@ Checks: >
3048
-concurrency-mt-unsafe,
3149
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
3250
-modernize-macro-to-enum,
33-
-readability-magic-numbers
51+
-readability-avoid-unconditional-preprocessor-if,
52+
-readability-implicit-bool-conversion,
53+
-readability-magic-numbers,
54+
-readability-use-concise-preprocessor-directives
3455
3556
CheckOptions:
3657
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
@@ -45,5 +66,8 @@ CheckOptions:
4566
value: true
4667
- key: readability-function-cognitive-complexity.Threshold
4768
value: 110
48-
69+
- key: misc-include-cleaner.IgnoreHeaders
70+
value: "SDL3/.*;criterion/.*;sys/time.h"
71+
- key: readability-implicit-bool-conversion.AllowLogicalOperatorConversion
72+
value: true
4973

0 commit comments

Comments
 (0)