|
1 | | -apply plugin: 'net.ltgt.errorprone' |
| 1 | +import static java.lang.System.getenv |
2 | 2 |
|
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' |
7 | 4 |
|
8 | 5 | tasks.withType(JavaCompile).configureEach { |
9 | 6 | 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 | + // 'CollectorMutability', // for freedom global exclude, might whitelist. https://github.com/diffplug/spotless/pull/2744#discussion_r2553042130 |
| 12 | + 'DoNotCallSuggester', // We don`t want to use ErrorProne's annotations. |
11 | 13 | 'FunctionalInterfaceMethodChanged', |
| 14 | + 'ImmutableEnumChecker', // We don`t want to use ErrorProne's annotations. |
| 15 | + 'InlineMeSuggester', // We don`t want to use ErrorProne's annotations. |
12 | 16 | 'JavaxInjectOnAbstractMethod', |
13 | 17 | 'OverridesJavaxInjectableMethod', |
| 18 | + 'ReturnValueIgnored', // We don`t want to use ErrorProne's annotations. |
| 19 | + // bug |
| 20 | + 'FieldMissingNullable', |
| 21 | + // 'Slf4jLogStatement', |
| 22 | + // 'Slf4jLoggerDeclaration', |
| 23 | + 'Var' |
14 | 24 | ) |
15 | 25 | error( |
16 | | - 'AmbiguousJsonCreator', |
17 | | - 'AssertJNullnessAssertion', |
18 | | - 'AutowiredConstructor', |
19 | | - 'CanonicalAnnotationSyntax', |
20 | | - 'CollectorMutability', |
21 | | - 'ConstantNaming', |
22 | | - 'DirectReturn', |
23 | | - 'EmptyMethod', |
24 | | - 'ExplicitArgumentEnumeration', |
25 | | - 'ExplicitEnumOrdering', |
26 | | - 'IdentityConversion', |
27 | | - 'ImmutablesSortedSetComparator', |
28 | | - 'IsInstanceLambdaUsage', |
29 | | - 'MockitoMockClassReference', |
30 | | - 'MockitoStubbing', |
31 | | - 'NestedOptionals', |
32 | | - 'PrimitiveComparison', |
33 | | - 'RedundantStringConversion', |
34 | | - 'RedundantStringEscape', |
| 26 | + // 'AmbiguousJsonCreator', |
| 27 | + // 'AssertJNullnessAssertion', |
| 28 | + // 'AutowiredConstructor', |
| 29 | + // 'CanonicalAnnotationSyntax', |
| 30 | + // 'CollectorMutability', |
| 31 | + // 'ConstantNaming', |
| 32 | + // 'DirectReturn', |
| 33 | + // 'EmptyMethod', |
| 34 | + // 'ExplicitArgumentEnumeration', |
| 35 | + // 'ExplicitEnumOrdering', |
| 36 | + // 'IdentityConversion', |
| 37 | + // 'ImmutablesSortedSetComparator', |
| 38 | + // 'IsInstanceLambdaUsage', |
| 39 | + // 'MissingOverride', |
| 40 | + // 'MockitoMockClassReference', |
| 41 | + // 'MockitoStubbing', |
| 42 | + // 'NestedOptionals', |
| 43 | + // 'PrimitiveComparison', |
| 44 | + // 'RedundantStringConversion', |
| 45 | + // 'RedundantStringEscape', |
35 | 46 | 'ReturnValueIgnored', |
36 | 47 | 'SelfAssignment', |
37 | 48 | 'StringJoin', |
38 | | - 'StringJoining', |
39 | 49 | 'UnnecessarilyFullyQualified', |
40 | 50 | 'UnnecessaryLambda', |
41 | 51 | ) |
42 | 52 | // bug: this only happens when the file is dirty. |
43 | 53 | // 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' |
| 54 | + // ForbidGradleInternal(import |
| 55 | + excludedPaths.set( |
| 56 | + '.*/GradleIntegrationHarness.java|'+ |
| 57 | + '.*/SelfTest.java' |
48 | 58 | ) |
| 59 | + if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) { |
| 60 | + errorproneArgs.addAll( |
| 61 | + '-XepPatchLocation:IN_PLACE', // how to prevent/ignore? @CanIgnoreReturnValue |
| 62 | + '-XepPatchChecks:' + |
| 63 | + 'MissingOverride' |
| 64 | + ) |
| 65 | + } |
49 | 66 | } |
50 | 67 | } |
| 68 | + |
| 69 | +dependencies { |
| 70 | + errorprone('com.google.errorprone:error_prone_core:2.42.0') |
| 71 | + // errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.26.0') |
| 72 | +} |
0 commit comments