Skip to content

fixed #14000 - deprecated the usage of rules #7657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Jul 9, 2025

No description provided.

Comment on lines +63 to +65
#ifdef _MSC_VER
#pragma message("The usage of rules is deprecated and will be removed in a future Cppcheck version. Please use addons instead.")
#endif
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the case when you compile it through the provided Visual Studio project which utilized neither CMake nor make.

@firewave firewave marked this pull request as ready for review July 9, 2025 13:24
Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. personally I really like to remove the rules feature. However I've wanted to get rid of rules for many years but when I have asked around there was always some users that strongly wanted to keep them..

It seems people don't want to touch any python code.

In theory we could add an addon that more or less simulates the cppcheck rules functionality. It can load the rules files and run the provided regular expressions.. I don't envision that it can be 100% compliant but it can provide similar functionality.

@danmar
Copy link
Owner

danmar commented Jul 11, 2025

@pfultz2 @orbitcowboy as far as I remember you have used rules..

@pfultz2
Copy link
Contributor

pfultz2 commented Jul 11, 2025

We do use some rules here: https://github.com/pfultz2/cppcheck-rules/blob/master/rules/UseStlAlgorithm/rule.xml

Its not really straightforward to translate those to addons.

@pfultz2
Copy link
Contributor

pfultz2 commented Jul 11, 2025

In theory we could add an addon that more or less simulates the cppcheck rules functionality. It can load the rules files and run the provided regular expressions.. I don't envision that it can be 100% compliant but it can provide similar functionality.

This would be slower, but not just because of the regex in python. The slowest part of the addon is loading the xml files, unfortunately.

It would be nice if we saved to protobuf(or something similiar) as it can build bindings in many different languages, and the loading would be much quicker.

@danmar
Copy link
Owner

danmar commented Jul 12, 2025

It would be nice if we saved to protobuf(or something similiar) as it can build bindings in many different languages, and the loading would be much quicker.

I agree. It is possible that Cppcheck Solutions can look into this someday but it is not very high on the prio list right now unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants