Clang-Tidy: Add loop checks

Add bugprone-infinite-loop and bugprone-too-small-loop-variable. Make
bugprone-infinite-loop an error.

Clang-Tidy checks apparently need to be specified in one blob. Do so in
each of our config files.
This commit is contained in:
Gerald Combs 2025-03-27 11:06:41 -07:00 committed by AndersBroman
parent b117767cf9
commit abefb51ceb
5 changed files with 6 additions and 16 deletions

View File

@ -13,10 +13,8 @@ ExtraArgs:
# Checks to run. A complete list of checks can be found at
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
Checks:
- '-*'
- 'misc-no-recursion'
Checks: '-*,misc-no-recursion,bugprone-infinite-loop,bugprone-too-small-loop-variable'
WarningsAsErrors: 'misc-no-recursion'
WarningsAsErrors: 'misc-no-recursion,bugprone-infinite-loop'
UseColor: true

View File

@ -3,8 +3,6 @@ InheritParentConfig: true
# We don't want to do any checks in this directory yet so hack around
# the fact that Clang-Tidy won't let us disable all checks.
# https://stackoverflow.com/a/58379342/82195
Checks:
- '-*'
- 'misc-definitions-in-headers'
Checks: '-*,misc-definitions-in-headers'
CheckOptions:
- { key: 'HeaderFileExtensions', value: 'DISABLED' }

View File

@ -3,8 +3,6 @@ InheritParentConfig: true
# We don't want to do any checks in this directory yet so hack around
# the fact that Clang-Tidy won't let us disable all checks.
# https://stackoverflow.com/a/58379342/82195
Checks:
- '-*'
- 'misc-definitions-in-headers'
Checks: '-*,misc-definitions-in-headers'
CheckOptions:
- { key: 'HeaderFileExtensions', value: 'DISABLED' }

View File

@ -3,8 +3,6 @@ InheritParentConfig: true
# We don't want to do any checks in this directory yet so hack around
# the fact that Clang-Tidy won't let us disable all checks.
# https://stackoverflow.com/a/58379342/82195
Checks:
- '-*'
- 'misc-definitions-in-headers'
Checks: '-*,misc-definitions-in-headers'
CheckOptions:
- { key: 'HeaderFileExtensions', value: 'DISABLED' }

View File

@ -3,8 +3,6 @@ InheritParentConfig: true
# We don't want to do any checks in this directory yet so hack around
# the fact that Clang-Tidy won't let us disable all checks.
# https://stackoverflow.com/a/58379342/82195
Checks:
- '-*'
- 'misc-definitions-in-headers'
Checks: '-*,misc-definitions-in-headers'
CheckOptions:
- { key: 'HeaderFileExtensions', value: 'DISABLED' }