diff --git a/changelog/@unreleased/pr-1677.v2.yml b/changelog/@unreleased/pr-1677.v2.yml new file mode 100644 index 000000000..d8c0220fa --- /dev/null +++ b/changelog/@unreleased/pr-1677.v2.yml @@ -0,0 +1,8 @@ +type: improvement +improvement: + description: |- + Disable AutoCloseableMustBeClosed by default + + Projects can choose to manually opt-in by enabling the `AutoCloseableMustBeClosed` check as part of their baseline configuration and running `./gradlew compileJava compileTestJava -PerrorProneApply=AutoCloseableMustBeClosed && ./gradlew format` to apply the automated fixes. + links: + - https://github.com/palantir/gradle-baseline/pull/1677 diff --git a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineErrorProne.java b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineErrorProne.java index 9ae455fe9..d71148da8 100644 --- a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineErrorProne.java +++ b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/plugins/BaselineErrorProne.java @@ -219,7 +219,7 @@ private static void configureErrorProneOptions( : CheckSeverity.OFF; })); - errorProneOptions.disable("CatchSpecificity", "UnusedVariable"); + errorProneOptions.disable("AutoCloseableMustBeClosed", "CatchSpecificity", "UnusedVariable"); errorProneOptions.error( "EqualsHashCode", "EqualsIncompatibleType",