Skip to content

Files

Latest commit

 

History

History
34 lines (23 loc) · 816 Bytes

NonASCIICharacter.md

File metadata and controls

34 lines (23 loc) · 816 Bytes

Pattern: Non-English character

Issue: -

Description

Scala allows unicode characters as operators and some editors misbehave when they see non-ascii character. This rule can be helpful in such situations.

"value".match {
case "value" => println("matched")
...
}

is preferred to

"value".match {
case "value"  println("matched")
...
}

To fix it, replace the (unicode operator) with =>.

Example configuration

<check enabled="true" class="org.scalastyle.scalariform.NonASCIICharacterChecker" level="warning"/>