Skip to content

Commit

Permalink
Build: Forbid implicit case fall-through without a comment and enable…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
findepi authored Oct 4, 2024
1 parent 746e719 commit f6cdf94
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions baseline.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
)
}
}
Expand Down

0 comments on commit f6cdf94

Please sign in to comment.