- Notifications
You must be signed in to change notification settings - Fork 15k
Description
The main goal is to move all implementations of checks in cert module into bugprone or other modules. (This is already done in the majority of cert checks)
Currently, there is a number of cert checks that are only contained in cert module:
llvm-project/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
Lines 32 to 44 in 1b8bedb
| #include "CommandProcessorCheck.h" | |
| #include "DefaultOperatorNewAlignmentCheck.h" | |
| #include "DontModifyStdNamespaceCheck.h" | |
| #include "FloatLoopCounter.h" | |
| #include "LimitedRandomnessCheck.h" | |
| #include "MutatingCopyCheck.h" | |
| #include "NonTrivialTypesLibcMemoryCallsCheck.h" | |
| #include "ProperlySeededRandomGeneratorCheck.h" | |
| #include "SetLongJmpCheck.h" | |
| #include "StaticObjectExceptionCheck.h" | |
| #include "StrToNumCheck.h" | |
| #include "ThrownExceptionTypeCheck.h" | |
| #include "VariadicFunctionDefCheck.h" |
This is problematic because the user will be faced with meaningless names like this:
| CheckFactories.registerCheck<FloatLoopCounter>("cert-flp30-c"); |
It's hard for the user to understand what cert-flp30-c means, so we should always have human-readable alternative to cert checks.
This is achieved by first creating a check in buprone or any other module and then making an alias to cert like this:
llvm-project/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
Lines 306 to 307 in 1b8bedb
| CheckFactories.registerCheck<bugprone::SuspiciousMemoryComparisonCheck>( | |
| "cert-flp37-c"); |
Essentially, this renaming can give "free checks" because people tend to just disable cert checks, despite most of them are regular bugprone checks that can give benefits for everyone.
As an example of how this renaming can be done, please see #157285.