1- apply plugin : ' net.ltgt.errorprone '
1+ import static java.lang.System.getenv
22
3- dependencies {
4- errorprone(' com.google.errorprone:error_prone_core:2.42.0' )
5- errorprone(' tech.picnic.error-prone-support:error-prone-contrib:0.26.0' )
6- }
3+ apply plugin : ' net.ltgt.errorprone'
74
85tasks. withType(JavaCompile ). configureEach {
96 options. errorprone {
10- disable( // consider fix, or reasoning.
7+ disableAllWarnings = true // https://github.com/diffplug/spotless/issues/2745 https://github.com/google/error-prone/issues/5365
8+ disable(
9+ // consider fix, or reasoning.
10+ ' AnnotateFormatMethod' , // We don`t want to use ErrorProne's annotations.
11+ ' CheckReturnValue' , // We don`t want to use ErrorProne's annotations.
12+ ' CollectorMutability' , // for freedom global exclude, might whitelist. https://github.com/diffplug/spotless/pull/2744#discussion_r2553042130
13+ ' DoNotCallSuggester' , // We don`t want to use ErrorProne's annotations.
1114 ' FunctionalInterfaceMethodChanged' ,
15+ ' ImmutableEnumChecker' , // We don`t want to use ErrorProne's annotations.
16+ ' InlineMeSuggester' , // We don`t want to use ErrorProne's annotations.
1217 ' JavaxInjectOnAbstractMethod' ,
1318 ' OverridesJavaxInjectableMethod' ,
19+ ' ReturnValueIgnored' , // We don`t want to use ErrorProne's annotations.
20+ // bug
21+ ' FieldMissingNullable' ,
22+ ' Slf4jLogStatement' ,
23+ ' Slf4jLoggerDeclaration' ,
24+ ' Var'
1425 )
1526 error(
1627 ' AmbiguousJsonCreator' ,
@@ -26,6 +37,7 @@ tasks.withType(JavaCompile).configureEach {
2637 ' IdentityConversion' ,
2738 ' ImmutablesSortedSetComparator' ,
2839 ' IsInstanceLambdaUsage' ,
40+ ' MissingOverride' ,
2941 ' MockitoMockClassReference' ,
3042 ' MockitoStubbing' ,
3143 ' NestedOptionals' ,
@@ -41,10 +53,22 @@ tasks.withType(JavaCompile).configureEach {
4153 )
4254 // bug: this only happens when the file is dirty.
4355 // might be an up2date (caching) issue, as file is currently in corrupt state.
44- // ForbidGradleInternal(import org.gradle.api.internal.project.ProjectInternal;)
45- errorproneArgs . add( ' -XepExcludedPaths: ' +
46- ' .*/SelfTest .java|' +
47- ' .*/GradleIntegrationHarness .java'
56+ // ForbidGradleInternal(import
57+ excludedPaths . set(
58+ ' .*/GradleIntegrationHarness .java|' +
59+ ' .*/SelfTest .java'
4860 )
61+ if (! getenv(). containsKey(' CI' ) && getenv(' IN_PLACE' )?. toBoolean()) {
62+ errorproneArgs. addAll(
63+ ' -XepPatchLocation:IN_PLACE' , // how to prevent/ignore? @CanIgnoreReturnValue
64+ ' -XepPatchChecks:' +
65+ ' MissingOverride'
66+ )
67+ }
4968 }
5069}
70+
71+ dependencies {
72+ errorprone(' com.google.errorprone:error_prone_core:2.42.0' )
73+ errorprone(' tech.picnic.error-prone-support:error-prone-contrib:0.26.0' )
74+ }
0 commit comments