Skip to content

fixed #14000 - deprecated the usage of rules#7657

Closed
firewave wants to merge 1 commit into
cppcheck-opensource:mainfrom
firewave:rule-depr
Closed

fixed #14000 - deprecated the usage of rules#7657
firewave wants to merge 1 commit into
cppcheck-opensource:mainfrom
firewave:rule-depr

Conversation

@firewave

@firewave firewave commented Jul 9, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread cli/cmdlineparser.cpp
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
Copy Markdown
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

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

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

danmar commented Jul 11, 2025

Copy link
Copy Markdown
Collaborator

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

@pfultz2

pfultz2 commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

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

pfultz2 commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

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

danmar commented Jul 12, 2025

Copy link
Copy Markdown
Collaborator

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.

@sonarqubecloud

Copy link
Copy Markdown

@firewave

Copy link
Copy Markdown
Collaborator Author

So somebody please file tickets for potential future work items and I will close the PR then.

@danmar

danmar commented Aug 22, 2025

Copy link
Copy Markdown
Collaborator

I created this ticket to drop the PCRE dependency:
https://trac.cppcheck.net/ticket/14087

@firewave

Copy link
Copy Markdown
Collaborator Author

I created this ticket to drop the PCRE dependency: https://trac.cppcheck.net/ticket/14087

There's also the points about protobuf/slow XML loading.

FYI I have a follow-up to the refactoring which adds std::regex support so we can disable PCRE out of.

@danmar

danmar commented Aug 28, 2025

Copy link
Copy Markdown
Collaborator

There's also the points about protobuf/slow XML loading.

I have created this ticket about changing the format of the dumpfiles:
https://trac.cppcheck.net/ticket/12831

@danmar

danmar commented Aug 28, 2025

Copy link
Copy Markdown
Collaborator

FYI I have a follow-up to the refactoring which adds std::regex support so we can disable PCRE out of.

👍

@firewave firewave closed this Aug 29, 2025
@firewave firewave deleted the rule-depr branch August 29, 2025 08:54
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