Skip to content

Commit e890042

Browse files
committed
Set Error Prone's options in one block
The checks that fail the build join excludedPaths in a single block, in alphabetical order. The checks that were only listed as comments for later are gone; the findings still to fix are in the build output.
1 parent b24961c commit e890042

1 file changed

Lines changed: 6 additions & 34 deletions

File tree

‎buildSrc/src/main/groovy/open-java-format.error-prone-conventions.gradle‎

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ tasks.withType(JavaCompile).configureEach {
1818
options.errorprone {
1919
// Annotation processor output (Immutables) is not ours to fix.
2020
excludedPaths = '.*/build/generated/.*'
21+
error('FormatStringConcatenation')
22+
error('JUnitClassModifiers')
23+
error('JUnitMethodDeclaration')
24+
error('RefactorSwitch')
25+
error('SameNameButDifferent')
26+
error('UnusedVariable')
2127
}
2228
}
2329

@@ -27,37 +33,3 @@ pluginManager.withPlugin('java-gradle-plugin') {
2733
options.errorprone.disable('JavaxInjectOnAbstractMethod')
2834
}
2935
}
30-
31-
// The checks vfs-s3 makes build-breaking. The commented ones stay off until the code is fixed, one check at a
32-
// time: StaticImport 84, LexicographicalAnnotationListing 46, RedundantStringConversion 6, AlmostJavadoc 3
33-
// findings; the rest have none.
34-
tasks.withType(JavaCompile).configureEach {
35-
options.errorprone {
36-
//error('StaticImport')
37-
//error('UnnecessarilyFullyQualified')
38-
//error('EmptyBlockTag')
39-
//error('OperatorPrecedence')
40-
//error('RedundantStringConversion')
41-
//error('PatternMatchingInstanceof')
42-
//error('UnnecessaryParentheses')
43-
//error('LexicographicalAnnotationListing')
44-
error('JUnitMethodDeclaration')
45-
error('JUnitClassModifiers')
46-
//error('MissingSummary')
47-
//error('AlmostJavadoc')
48-
//error('BadImport')
49-
//error('JdkObsolete')
50-
// NonStaticImport (Picnic) is the inverse of StaticImport and would give contradictory advice.
51-
//disable('NonStaticImport')
52-
}
53-
}
54-
55-
// Checks whose findings have been fixed, build-breaking so that new ones are fixed too rather than read past.
56-
tasks.withType(JavaCompile).configureEach {
57-
options.errorprone {
58-
error('FormatStringConcatenation')
59-
error('RefactorSwitch')
60-
error('SameNameButDifferent')
61-
error('UnusedVariable')
62-
}
63-
}

0 commit comments

Comments
 (0)