Skip to content
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

Fix -XepDisableAllWarnings flag when passed on its own #3462

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public ScannerSupplier applyOverrides(ErrorProneOptions errorProneOptions) {
&& errorProneOptions.getFlags().isEmpty()
&& !errorProneOptions.isEnableAllChecksAsWarnings()
&& !errorProneOptions.isDropErrorsToWarnings()
&& !errorProneOptions.isDisableAllChecks()) {
&& !errorProneOptions.isDisableAllChecks()
&& !errorProneOptions.isDisableAllWarnings()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch. Checking the usages of parameter errorProneOptions in this method, I suspect that this if-statement should also add && !errorProneOptions.ignoreUnknownChecks()?

Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, this method checks whether some/all checks have an overridden severity; ignoreUnknownChecks is different (and BTW is also useless without specific severity overrides, so would be implicitly covered anyway)

Copy link
Contributor

Choose a reason for hiding this comment

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

is also useless without specific severity overrides, so would be implicitly covered anyway

Right! 🤦

return this;
}

Expand Down