I got following code:
string match {
case Regex(_, "1", "0", _, _) =>
case Regex(_, "1", "1", null, _) =>
}
Scalastyle is complaining about usage of null which cannot be avoided here. Any way I can suppress warning just for this line?
Scalastyle understands suppression comments:
// scalastyle:off <rule id>
...
// scalastyle:on <rule id>
Rule ids are listed here
In your case, the id is simply null:
// scalastyle:off null
...
// scalastyle:on null
This was also answered on the mailing list
For a single line, you just append // scalastyle:ignore <rule-id>
to the end, like so:
string match {
case Regex(_, "1", "0", _, _) =>
case Regex(_, "1", "1", null, _) => // scalastyle:ignore null
}
If it's obvious what you want Scalastyle to ignore, you can disable all checks for the current line by omitting the rule-id (as you can for the on/off comments as well):
string match {
case Regex(_, "1", "0", _, _) =>
case Regex(_, "1", "1", null, _) => // scalastyle:ignore
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With