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

Conversation

msridhar
Copy link
Contributor

Without this change, the flag would not work when passed as the single Error Prone argument. Not sure how to add a regression test for this, but the fix works locally.

@msridhar msridhar changed the title Fix -XepDisableAllWarnings flag Fix -XepDisableAllWarnings flag when passed on its own Sep 29, 2022
@@ -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! 🤦

@msridhar
Copy link
Contributor Author

msridhar commented Oct 5, 2022

FYI @cushon. I think this is a pretty safe bug fix

copybara-service bot pushed a commit that referenced this pull request Oct 17, 2022
Without this change, the flag would not work when passed as the single Error Prone argument.  Not sure how to add a regression test for this, but the fix works locally.

Fixes #3462

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3462 from msridhar:fix-disable-all-warnings 89f2c1d
PiperOrigin-RevId: 481263162
copybara-service bot pushed a commit that referenced this pull request Oct 17, 2022
Without this change, the flag would not work when passed as the single Error Prone argument.  Not sure how to add a regression test for this, but the fix works locally.

Fixes #3462

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3462 from msridhar:fix-disable-all-warnings 89f2c1d
PiperOrigin-RevId: 481263162
copybara-service bot pushed a commit that referenced this pull request Oct 17, 2022
Without this change, the flag would not work when passed as the single Error Prone argument.  Not sure how to add a regression test for this, but the fix works locally.

Fixes #3462

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3462 from msridhar:fix-disable-all-warnings 89f2c1d
PiperOrigin-RevId: 481263162
@msridhar
Copy link
Contributor Author

msridhar commented Nov 8, 2022

Was there some issue with merging this PR? I see commits related to it but nothing yet on the main branch.

@cpovirk
Copy link
Member

cpovirk commented Nov 8, 2022

Oops. I think I see what happened, and it might be an easy fix....

copybara-service bot pushed a commit that referenced this pull request Nov 9, 2022
Without this change, the flag would not work when passed as the single Error Prone argument.  Not sure how to add a regression test for this, but the fix works locally.

Fixes #3462

FUTURE_COPYBARA_INTEGRATE_REVIEW=#3462 from msridhar:fix-disable-all-warnings 89f2c1d
PiperOrigin-RevId: 487006986
@copybara-service copybara-service bot closed this in cbaf3bb Nov 9, 2022
@msridhar msridhar deleted the fix-disable-all-warnings branch November 9, 2022 14:42
benkard pushed a commit to benkard/jgvariant that referenced this pull request Jan 14, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.google.errorprone:error_prone_core](https://errorprone.info) ([source](https://github.com/google/error-prone)) |  | minor | `2.16` -> `2.18.0` |
| [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | compile | minor | `2.16` -> `2.18.0` |
| [org.apache.maven.plugins:maven-failsafe-plugin](https://maven.apache.org/surefire/) | build | patch | `3.0.0-M7` -> `3.0.0-M8` |
| [org.apache.maven.plugins:maven-surefire-plugin](https://maven.apache.org/surefire/) | build | patch | `3.0.0-M7` -> `3.0.0-M8` |

---

### Release Notes

<details>
<summary>google/error-prone</summary>

### [`v2.18.0`](https://github.com/google/error-prone/releases/tag/v2.18.0): Error Prone 2.18.0

[Compare Source](google/error-prone@v2.17.0...v2.18.0)

New Checkers:

-   [`InjectOnBugCheckers`](https://errorprone.info/bugpattern/InjectOnBugCheckers)
-   [`LabelledBreakTarget`](https://errorprone.info/bugpattern/LabelledBreakTarget)
-   [`UnusedLabel`](https://errorprone.info/bugpattern/UnusedLabel)
-   [`YodaCondition`](https://errorprone.info/bugpattern/YodaCondition)

Fixes issues: [#&#8203;1650](google/error-prone#1650), [#&#8203;2706](google/error-prone#2706), [#&#8203;3404](google/error-prone#3404), [#&#8203;3493](google/error-prone#3493), [#&#8203;3504](google/error-prone#3504), [#&#8203;3519](google/error-prone#3519), [#&#8203;3579](google/error-prone#3579), [#&#8203;3610](google/error-prone#3610), [#&#8203;3632](google/error-prone#3632), [#&#8203;3638](google/error-prone#3638), [#&#8203;3645](google/error-prone#3645), [#&#8203;3646](google/error-prone#3646), [#&#8203;3652](google/error-prone#3652), [#&#8203;3690](google/error-prone#3690)

**Full Changelog**: google/error-prone@v2.17.0...v2.18.0

### [`v2.17.0`](https://github.com/google/error-prone/releases/tag/v2.17.0): Error Prone 2.17.0

[Compare Source](google/error-prone@v2.16...v2.17.0)

New Checkers:

-   [`AvoidObjectArrays`](https://errorprone.info/bugpattern/AvoidObjectArrays)
-   [`Finalize`](https://errorprone.info/bugpattern/Finalize)
-   [`IgnoredPureGetter`](https://errorprone.info/bugpattern/IgnoredPureGetter)
-   [`ImpossibleNullComparison`](https://errorprone.info/bugpattern/ProtoFieldNullComparison)
-   [`MathAbsoluteNegative`](https://errorprone.info/bugpattern/MathAbsoluteNegative)
-   [`NewFileSystem`](https://errorprone.info/bugpattern/NewFileSystem)
-   [`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch)
-   [`UnqualifiedYield`](https://errorprone.info/bugpattern/UnqualifiedYield)

Fixed issues: [#&#8203;2321](google/error-prone#2321), [#&#8203;3144](google/error-prone#3144), [#&#8203;3297](google/error-prone#3297), [#&#8203;3428](google/error-prone#3428), [#&#8203;3437](google/error-prone#3437), [#&#8203;3462](google/error-prone#3462), [#&#8203;3482](google/error-prone#3482), [#&#8203;3494](google/error-prone#3494)

**Full Changelog**: google/error-prone@v2.16...v2.17.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
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.

5 participants