-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
improved determination if application is Premium / added TODOs #7346
base: main
Are you sure you want to change the base?
Conversation
const std::string manualUrl(premium ? | ||
"https://files.cppchecksolutions.com/manual.pdf" : | ||
"https://cppcheck.sourceforge.io/manual.pdf"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were switched.
This is in preparation of avoiding It also gets rid of loading the |
"about": "NAME", | ||
"safety": true | ||
"about": "NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was based on the behavior that is loaded cppcheck.cfg
first and being overriden by the CLI. But that is not how it was initially implemented. That behavior changed when the double loading was introduced in #5760.
assert exitcode == 0 | ||
assert '<safety/>' in stderr | ||
|
||
exitcode, _, stderr = cppcheck(['--xml-version=3', '--premium=safety-off', test_file], cppcheck_exe=exe) | ||
exitcode, _, stderr = cppcheck(['--xml-version=3', test_file], cppcheck_exe=exe) | ||
assert exitcode == 0 | ||
assert '<safety/>' not in stderr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cppcheck Premium should enable safety by default. So I expect <safety/>
in xml output unless it's explicitly turned off with --premium=safety-off
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cppcheck Premium should enable safety by default.
That means that it is explicitly enabled in cppcheck.cfg
, right? Should it even be allowed to be disabled by default if it is premium (i.e. <safety>
is missing or set to false
)?
What about --no-safety
? May it also override the premium safety (default)? Or should that be limited to --premium=safety-off
?
I would be fine having special handling for the safety flag. I just would have it properly defined.
assert exitcode == 0 | ||
assert 'id="unusedVariable"' in stderr | ||
assert 'id="checkersReport"' in stderr | ||
|
||
exitcode, _, stderr = cppcheck(['--premium=autosar', '--premium=safety-off', '--xml', test_file], cppcheck_exe=exe) | ||
exitcode, _, stderr = cppcheck(['--premium=autosar', '--xml', test_file], cppcheck_exe=exe) | ||
assert exitcode == 0 | ||
assert 'id="unusedVariable"' in stderr | ||
assert 'id="checkersReport"' not in stderr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect to see checkersReport in the Cppcheck Premium output unless --premium=safety-off
is provided.
No description provided.