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.
17+ ' JUnitClassModifiers' ,
1218 ' JavaxInjectOnAbstractMethod' ,
19+ ' LexicographicalAnnotationAttributeListing' ,
20+ ' NonStaticImport' ,
21+ ' StaticImport' ,
22+ ' LexicographicalAnnotationListing' ,
1323 ' OverridesJavaxInjectableMethod' ,
24+ ' ReturnValueIgnored' , // We don`t want to use ErrorProne's annotations.
25+ // bug
26+ ' FieldMissingNullable' ,
27+ ' Slf4jLogStatement' ,
28+ ' Slf4jLoggerDeclaration' ,
29+ ' Var'
1430 )
1531 error(
1632 ' AmbiguousJsonCreator' ,
@@ -26,25 +42,42 @@ tasks.withType(JavaCompile).configureEach {
2642 ' IdentityConversion' ,
2743 ' ImmutablesSortedSetComparator' ,
2844 ' IsInstanceLambdaUsage' ,
45+ ' MissingOverride' ,
2946 ' MockitoMockClassReference' ,
3047 ' MockitoStubbing' ,
3148 ' NestedOptionals' ,
49+ ' NonStaticImport' ,
3250 ' PrimitiveComparison' ,
3351 ' RedundantStringConversion' ,
3452 ' RedundantStringEscape' ,
3553 ' ReturnValueIgnored' ,
3654 ' SelfAssignment' ,
55+ ' StaticImport' ,
3756 ' StringJoin' ,
3857 ' StringJoining' ,
3958 ' UnnecessarilyFullyQualified' ,
4059 ' UnnecessaryLambda' ,
4160 )
4261 // bug: this only happens when the file is dirty.
4362 // 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'
63+ // ForbidGradleInternal(import
64+ excludedPaths . set(
65+ ' .*/GradleIntegrationHarness .java|' +
66+ ' .*/SelfTest .java'
4867 )
68+ if (! getenv(). containsKey(' CI' ) && getenv(' IN_PLACE' )?. toBoolean()) {
69+ errorproneArgs. addAll(
70+ ' -XepPatchLocation:IN_PLACE' , // how to prevent/ignore? @CanIgnoreReturnValue
71+ ' -XepPatchChecks:' +
72+ ' MissingOverride,' +
73+ ' NonStaticImport,' +
74+ ' StaticImport'
75+ )
76+ }
4977 }
5078}
79+
80+ dependencies {
81+ errorprone(' com.google.errorprone:error_prone_core:2.42.0' )
82+ errorprone(' tech.picnic.error-prone-support:error-prone-contrib:0.26.0' )
83+ }
0 commit comments