-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #341 from olafurpg/moar-lints
Fix linter issues discovered while writing scala-lang blogpost.
- Loading branch information
Showing
8 changed files
with
119 additions
and
55 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
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
12 changes: 12 additions & 0 deletions
12
scalafix-tests/input/src/main/scala/test/LintAsserts.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
rules = [ | ||
NoInfer | ||
"class:scalafix.test.DummyLinter" | ||
] | ||
*/ | ||
package test | ||
|
||
class LintAsserts { | ||
List(1, (1, 2)) // assert: NoInfer.any | ||
} | ||
// assert: DummyLinter |
13 changes: 13 additions & 0 deletions
13
scalafix-tests/unit/src/main/scala/scalafix/test/DummyLinter.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package scalafix.test | ||
|
||
import scalafix.LintCategory | ||
import scalafix.LintMessage | ||
import scalafix.Rule | ||
import scalafix.RuleCtx | ||
|
||
object DummyLinter extends Rule("DummyLinter") { | ||
val error = LintCategory.error("Bam!") | ||
override def check(ctx: RuleCtx): Seq[LintMessage] = { | ||
error.at(ctx.tokenList.prev(ctx.tokens.last).pos) :: Nil | ||
} | ||
} |