-
Notifications
You must be signed in to change notification settings - Fork 383
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
[bugfix] Don't trigger analyzer without enabled checkers #3970
Conversation
Sometimes users want to execute exactly one checker. This can be done by disabling all checkers and then enabling that one. Some analyzers fail if no checker is enabled. For example, if the user wants to enable one ClangSA checker and disable everything else explicitly, then ClangTidy fails. After this patch an analyzer will not be triggered if all of its checkers are disabled.
no_checker_analyzers = \ | ||
[a for a in analyzers if not __has_enabled_checker(config_map[a])] | ||
for analyzer in no_checker_analyzers: | ||
LOG.info("No checkers enabled for %s", analyzer) |
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.
Can we tell if the user explicitly enabled an analyzer? If so, we should hard error, shouldn't we?
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 can be convinced, but I would feel a hard error a little strong here.
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'll give you that one.
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.
LGTM
Add --disable-all flag which disables all checkers of all analyzers. It is equilent to using "--disable default".
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.
LGTM still
Sometimes users want to execute exactly one checker. This can be done by disabling all checkers and then enabling that one. Some analyzers fail if no checker is enabled. For example, if the user wants to enable one ClangSA checker and disable everything else explicitly, then ClangTidy fails.
After this patch an analyzer will not be triggered if all of its checkers are disabled.
[cmd] Add --disable-all flag
Add --disable-all flag which disables all checkers of all analyzers. It
is equilent to using "--disable default".
Should be merged after #3949.