Uh oh!
There was an error while loading. Please reload this page.
refs #14498 - do not create global static instances of the checks - #8555
Conversation
firewave
commented
May 13, 2026
Since we switched to non- As a follow-up we can stop relying on the global check instances in the tests and use local ones instead. As a final step this will (hopefully) finally allow us to land #5323. |
| Check& operator=(const Check &) = delete; | ||
| /** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */ | ||
| static std::list<Check *> &instances(); |
There was a problem hiding this comment.
As another positive side effect this no longer needs to return a mutable reference.
| private: | ||
| void run() override { | ||
| TEST_CASE(instancesSorted); |
There was a problem hiding this comment.
As we now have a fixed order of the checks there no longer is any reason to sort them.
e29a0c1 to
34f7be7CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ab5d808 to
d6d29c5Compare…d instead just not implementing them
Uh oh!
There was an error while loading. Please reload this page.
| { | ||
| private: | ||
| /* *INDENT-OFF* */ | ||
| #define UPI(c) std::unique_ptr<c> m##c{new c} |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
firewave
commented
May 15, 2026
Maybe someone can come up with an improved macro that would also build the list so we only need to specify the check name once. Could also be done in a follow-up since I have other changes already lined up. |
danmar
left a comment
There was a problem hiding this comment.
Alright. I wanted from the start that checks are dynamic so it would be possible to link extra checker classes dynamically. I.e. users could develop custom checkers.
But checkers will never be linked dynamically in that way so we can as well do this.
Uh oh!
There was an error while loading. Please reload this page.
firewave
commented
May 16, 2026
I think that plan was superseded by the addons. Even if that functionality would be added those can still be dynamically added to the list - should be even more possible then before when the object creation wasn't controlled. |
No description provided.