From 2ec2c3985ca1d3d39fa17038fa0dc51fbb8ed18c Mon Sep 17 00:00:00 2001 From: David Schlosnagle Date: Fri, 5 Mar 2021 22:42:06 -0500 Subject: [PATCH 1/2] Disable AutoCloseableMustBeClosed by default --- .../com/palantir/baseline/plugins/BaselineErrorProne.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 6628004362bd4887d8b907b80213254cd1c2a1b3 Mon Sep 17 00:00:00 2001 From: David Schlosnagle Date: Sat, 6 Mar 2021 03:42:06 +0000 Subject: [PATCH 2/2] Add generated changelog entries --- changelog/@unreleased/pr-1677.v2.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 changelog/@unreleased/pr-1677.v2.yml 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