forked from scalastyle/scalastyle
-
Notifications
You must be signed in to change notification settings - Fork 3
Scalastyle proposed rules (Pattern matching)
Matthew Farwell edited this page Jul 22, 2012
·
1 revision
This page contains proposed rules for Scalastyle, section Modifiers.
This rule detect when pattern-matching against an existing uncapitalized identifier. Since the matching will ignore/shadow the existing identifier, it could be a sign of mistake by the developer. Any time a pattern variable match an in-scope identifier. Even with backtick.
In any case the check does not pass when the previous case occurs. But there are different configurable resolution for which the check will pass when the code try to match on an existing identifier value:
- nobacktick: the check will refuse backticked identifier.
- constant: the check will accept constant identifier (ie identifier passing the constant check (todo: link)). This could imply backtick if the constant pattern tolerate uncapitalized names.
- backtickOrConstant: any explicitation will make the check pass.