|
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 | + 'DoNotCallSuggester', // We don`t want to use ErrorProne's annotations. |
11 | 12 | 'FunctionalInterfaceMethodChanged', |
| 13 | + 'ImmutableEnumChecker', // We don`t want to use ErrorProne's annotations. |
| 14 | + 'InlineMeSuggester', // We don`t want to use ErrorProne's annotations. |
12 | 15 | 'JavaxInjectOnAbstractMethod', |
13 | 16 | 'OverridesJavaxInjectableMethod', |
| 17 | + 'ReturnValueIgnored', // We don`t want to use ErrorProne's annotations. |
14 | 18 | ) |
15 | 19 | 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', |
35 | 20 | 'ReturnValueIgnored', |
36 | 21 | 'SelfAssignment', |
37 | 22 | 'StringJoin', |
38 | | - 'StringJoining', |
39 | 23 | 'UnnecessarilyFullyQualified', |
40 | 24 | 'UnnecessaryLambda', |
41 | 25 | ) |
42 | | - // bug: this only happens when the file is dirty. |
43 | | - // 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' |
48 | | - ) |
| 26 | + if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) { |
| 27 | + errorproneArgs.addAll( |
| 28 | + '-XepPatchLocation:IN_PLACE', |
| 29 | + '-XepPatchChecks:' + |
| 30 | + 'MissingOverride' |
| 31 | + ) |
| 32 | + } |
49 | 33 | } |
50 | 34 | } |
| 35 | + |
| 36 | +dependencies { |
| 37 | + errorprone('com.google.errorprone:error_prone_core:2.42.0') |
| 38 | +} |
0 commit comments