Build: Forbid implicit case fall-through without a comment and enable couple more recommendable error-prone checks (#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
pull/11256/head
Piotr Findeisen 4 months ago committed by GitHub
parent 746e71931a
commit f6cdf94094
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -83,6 +83,8 @@ subprojects {
'-Xep:BadComparable:ERROR',
'-Xep:BadInstanceof:ERROR',
'-Xep:CatchFail:ERROR',
'-Xep:ClassCanBeStatic:ERROR',
'-Xep:ClassNewInstance:ERROR',
'-Xep:CollectionUndefinedEquality:ERROR',
// specific to Palantir - Uses name `log` but we use name `LOG`
'-Xep:ConsistentLoggerName:OFF',
@ -95,8 +97,10 @@ subprojects {
'-Xep:EqualsUnsafeCast:ERROR',
'-Xep:EqualsUsingHashCode:ERROR',
'-Xep:ExtendsObject:ERROR',
'-Xep:FallThrough:ERROR',
// specific to Palantir
'-Xep:FinalClass:OFF',
'-Xep:Finalize:ERROR',
'-Xep:FormatStringAnnotation:ERROR',
'-Xep:GetClassOnEnum:ERROR',
'-Xep:HidingField:ERROR',
@ -146,10 +150,14 @@ subprojects {
'-Xep:StringSplitter:ERROR',
'-Xep:TypeParameterShadowing:OFF',
'-Xep:TypeParameterUnusedInFormals:OFF',
'-Xep:UnicodeEscape:ERROR',
// Palantir's UnnecessarilyQualified may throw during analysis
'-Xep:UnnecessarilyQualified:OFF',
'-Xep:UnnecessaryLongToIntConversion:ERROR',
'-Xep:UnnecessaryMethodReference:ERROR',
'-Xep:UnusedMethod:ERROR',
'-Xep:UnusedVariable:ERROR',
'-Xep:UseEnumSwitch:ERROR',
)
}
}

Loading…
Cancel
Save