Skip to content

Commit f6cdf94

Browse files
authored
Build: Forbid implicit case fall-through without a comment and enable couple more recommendable error-prone checks (apache#11251)
* Forbid implicit case fall-through without a comment In ordinary switch statement, case branches implicitly fall-through to the next one. This is Java's C legacy. Forbid this unless intent is indicated in the code with a comment like `// fall through`. * Enable couple more recommendable error-prone checks
1 parent 746e719 commit f6cdf94

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

baseline.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ subprojects {
8383
'-Xep:BadComparable:ERROR',
8484
'-Xep:BadInstanceof:ERROR',
8585
'-Xep:CatchFail:ERROR',
86+
'-Xep:ClassCanBeStatic:ERROR',
87+
'-Xep:ClassNewInstance:ERROR',
8688
'-Xep:CollectionUndefinedEquality:ERROR',
8789
// specific to Palantir - Uses name `log` but we use name `LOG`
8890
'-Xep:ConsistentLoggerName:OFF',
@@ -95,8 +97,10 @@ subprojects {
9597
'-Xep:EqualsUnsafeCast:ERROR',
9698
'-Xep:EqualsUsingHashCode:ERROR',
9799
'-Xep:ExtendsObject:ERROR',
100+
'-Xep:FallThrough:ERROR',
98101
// specific to Palantir
99102
'-Xep:FinalClass:OFF',
103+
'-Xep:Finalize:ERROR',
100104
'-Xep:FormatStringAnnotation:ERROR',
101105
'-Xep:GetClassOnEnum:ERROR',
102106
'-Xep:HidingField:ERROR',
@@ -146,10 +150,14 @@ subprojects {
146150
'-Xep:StringSplitter:ERROR',
147151
'-Xep:TypeParameterShadowing:OFF',
148152
'-Xep:TypeParameterUnusedInFormals:OFF',
153+
'-Xep:UnicodeEscape:ERROR',
149154
// Palantir's UnnecessarilyQualified may throw during analysis
150155
'-Xep:UnnecessarilyQualified:OFF',
156+
'-Xep:UnnecessaryLongToIntConversion:ERROR',
157+
'-Xep:UnnecessaryMethodReference:ERROR',
151158
'-Xep:UnusedMethod:ERROR',
152159
'-Xep:UnusedVariable:ERROR',
160+
'-Xep:UseEnumSwitch:ERROR',
153161
)
154162
}
155163
}

0 commit comments

Comments
 (0)