Add a clang-tidy file

This gives us the ninja clang-tidy command. clang-tidy replaces
scan-build and is more featureful (and picky).

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1182>
This commit is contained in:
Peter Hutterer 2025-04-03 13:25:51 +10:00 committed by Marge Bot
parent cc0889bf2b
commit 6876d71a4d
3 changed files with 12 additions and 0 deletions

5
.clang-tidy Normal file
View file

@ -0,0 +1,5 @@
# optin.core.EnumCastOutOfRange: disabled because we use a lot of "wrong" enum values for testing
# and internally and don't want those values leak into the public API
Checks: >
-clang-analyzer-optin.core.EnumCastOutOfRange
WarningsAsErrors: true

1
.clang-tidy-ignore Normal file
View file

@ -0,0 +1 @@
include/*

6
test/.clang-tidy Normal file
View file

@ -0,0 +1,6 @@
# optin.core.FloatLoopCounter: doubles in for loops - it's fine in the tests
# optin.performance.Padding: not a performance concern in the tests
InheritParentConfig: true
Checks: >
-clang-analyzer-security.FloatLoopCounter,
-clang-analyzer-optin.performance.Padding,