forked from scalacenter/scalafix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the commit message scalacenter#2: unit3 munit dep: exclude 2.13 and include munit_3 instead
- Loading branch information
Showing
6 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
scalafix-tests/unit/src/main/scala/scalafix/test/NoNull.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
package scalafix.test | ||
|
||
import scala.meta._ | ||
import scala.meta.Lit | ||
import scala.meta.XtensionCollectionLikeUI | ||
|
||
import scalafix.v0._ | ||
import scalafix.lint.Diagnostic | ||
import scalafix.v0.LintCategory | ||
import scalafix.v0.Rule | ||
import scalafix.v0.RuleCtx | ||
|
||
object NoNull extends Rule("NoNull") { | ||
val error: LintCategory = LintCategory.error("Nulls are not allowed.") | ||
|
||
override def check(ctx: RuleCtx): List[Diagnostic] = ctx.tree.collect { | ||
case nil @ q"null" => error.at(nil.pos) | ||
case nil @ Lit.Null() => error.at(nil.pos) | ||
} | ||
} |