@@ -9,8 +9,10 @@ plugins {
99}
1010
1111dependencies {
12- errorprone(dependencyFromLibs(" errorProne-core" ))
12+ errorprone(dependencyFromLibs(" error-prone-contrib" ))
13+ errorprone(dependencyFromLibs(" error-prone-core" ))
1314 errorprone(dependencyFromLibs(" nullaway" ))
15+ errorprone(dependencyFromLibs(" refaster-runner" ))
1416 constraints {
1517 errorprone(" com.google.guava:guava" ) {
1618 version {
@@ -27,6 +29,65 @@ nullaway {
2729
2830tasks.withType<JavaCompile >().configureEach {
2931 options.errorprone {
32+ disableWarningsInGeneratedCode = true
33+ allErrorsAsWarnings = true
34+ errorproneArgs.add(" -XepOpt:Refaster:NamePattern=^(?!.*Rules\\ \$ ).*" ) // not complain; reduce after merge.
35+ if (System .getenv(" IN_PLACE" )?.toBooleanStrictOrNull() ? : false ) {
36+ errorproneArgs.addAll(
37+ " -XepPatchLocation:IN_PLACE" , // somehow only picnic works
38+ " -XepPatchChecks:" +
39+ " AddNullMarkedToPackageInfo," +
40+ " AmbiguousJsonCreator," +
41+ " AssertJNullnessAssertion," +
42+ " AutowiredConstructor," +
43+ " CanonicalAnnotationSyntax," +
44+ " CanonicalClassNameUsage," +
45+ " ClassCastLambdaUsage," +
46+ " CollectorMutability," +
47+ " ConstantNaming," +
48+ " DeadException," +
49+ " DefaultCharset," +
50+ " DirectReturn," + // why only this working?
51+ " EagerStringFormatting," +
52+ " EmptyMethod," +
53+ " EmptyMonoZip," +
54+ " ExplicitArgumentEnumeration," +
55+ " ExplicitEnumOrdering," +
56+ " FluxFlatMapUsage," +
57+ " FluxImplicitBlock," +
58+ " FormatStringConcatenation," +
59+ " IdentityConversion," +
60+ " ImmutablesSortedSetComparator," +
61+ " IsInstanceLambdaUsage," +
62+ " JUnitClassModifiers," +
63+ " JUnitMethodDeclaration," +
64+ " JUnitNullaryParameterizedTestDeclaration," +
65+ " JUnitValueSource," +
66+ " LexicographicalAnnotationAttributeListing," +
67+ " LexicographicalAnnotationListing," +
68+ " MissingOverride," +
69+ " MockitoMockClassReference," +
70+ " MockitoStubbing," +
71+ " MongoDBTextFilterUsage," +
72+ " NestedOptionals," +
73+ " NestedPublishers," +
74+ " NonEmptyMono," +
75+ " NonStaticImport," +
76+ " OptionalOrElseGet," +
77+ " PrimitiveComparison," +
78+ " RedundantStringConversion," +
79+ " RedundantStringEscape," +
80+ " RefasterAnyOfUsage," +
81+ " RequestMappingAnnotation," +
82+ " RequestParamType," +
83+ " Slf4jLogStatement," +
84+ " Slf4jLoggerDeclaration," +
85+ " SpringMvcAnnotation," +
86+ " StaticImport," +
87+ " StringJoin," + // why only this working?
88+ " TimeZoneUsage"
89+ );
90+ }
3091 val shouldDisableErrorProne = java.toolchain.implementation.orNull == JvmImplementation .J9
3192 if (name == " compileJava" && ! shouldDisableErrorProne) {
3293 disable(
@@ -50,6 +111,58 @@ tasks.withType<JavaCompile>().configureEach {
50111 // Produces a lot of findings that we consider to be false positives, for example for package-private
51112 // classes and methods
52113 " MissingSummary" ,
114+
115+ // picnic (TBD) https://error-prone.picnic.tech
116+ " AddNullMarkedToPackageInfo" ,
117+ " AmbiguousJsonCreator" ,
118+ " AssertJNullnessAssertion" ,
119+ " AutowiredConstructor" ,
120+ " CanonicalAnnotationSyntax" ,
121+ " CanonicalClassNameUsage" ,
122+ " ClassCastLambdaUsage" ,
123+ " CollectorMutability" ,
124+ " ConstantNaming" ,
125+ " DeadException" ,
126+ " DefaultCharset" ,
127+ " EagerStringFormatting" ,
128+ " EmptyMethod" ,
129+ " EmptyMonoZip" ,
130+ " ExplicitArgumentEnumeration" ,
131+ " ExplicitEnumOrdering" ,
132+ " FluxFlatMapUsage" ,
133+ " FluxImplicitBlock" ,
134+ " FormatStringConcatenation" ,
135+ " IdentityConversion" ,
136+ " ImmutablesSortedSetComparator" ,
137+ " IsInstanceLambdaUsage" ,
138+ " JUnitClassModifiers" ,
139+ " JUnitMethodDeclaration" ,
140+ " JUnitNullaryParameterizedTestDeclaration" ,
141+ " JUnitValueSource" ,
142+ " LexicographicalAnnotationAttributeListing" ,
143+ " LexicographicalAnnotationListing" ,
144+ " LexicographicalAnnotationListing" ,
145+ " MissingOverride" ,
146+ " MockitoMockClassReference" ,
147+ " MockitoStubbing" ,
148+ " MongoDBTextFilterUsage" ,
149+ " NestedOptionals" ,
150+ " NestedPublishers" ,
151+ " NonEmptyMono" ,
152+ " NonStaticImport" ,
153+ " OptionalOrElseGet" ,
154+ " PrimitiveComparison" ,
155+ " RedundantStringConversion" ,
156+ " RedundantStringEscape" ,
157+ " RequestMappingAnnotation" ,
158+ " RequestParamType" ,
159+ " Slf4jLogStatement" ,
160+ " Slf4jLoggerDeclaration" ,
161+ " SpringMvcAnnotation" ,
162+ " StaticImport" ,
163+ " TimeZoneUsage" ,
164+ // "DirectReturn", fixed
165+ // "StringJoin", fixed
53166 )
54167 error(" PackageLocation" )
55168 } else {
0 commit comments