Skip to content

Commit

Permalink
add more FileNameConsistent test
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Feb 4, 2025
1 parent 08a84ab commit dc0e94b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sbt-test/FileNameConsistent/test-1/.scalafix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules = [
FileNameConsistent
]
1 change: 1 addition & 0 deletions sbt-test/FileNameConsistent/test-1/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ThisBuild / scalafixDependencies += "com.github.xuwei-k" %% "scalafix-rules" % sys.props("scalafix-rules.version")
12 changes: 12 additions & 0 deletions sbt-test/FileNameConsistent/test-1/expect.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[{
"message": "[FileNameConsistent] inconsistent file name and class name. names = [Y]",
"position": {
"line": 3,
"lineContent": "class Y",
"sourcePath": "${BASE}/src/main/scala/a/X.scala",
"startLine": 3,
"startColumn": 0,
"endLine": 3,
"endColumn": 7
}
}]
2 changes: 2 additions & 0 deletions sbt-test/FileNameConsistent/test-1/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % sys.props("scalafix.version"))
addSbtPlugin("com.github.xuwei-k" % "warning-diff-scalafix-plugin" % "0.6.0")
3 changes: 3 additions & 0 deletions sbt-test/FileNameConsistent/test-1/src/main/scala/a/A.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package a

object A
3 changes: 3 additions & 0 deletions sbt-test/FileNameConsistent/test-1/src/main/scala/a/X.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package a

class Y
2 changes: 2 additions & 0 deletions sbt-test/FileNameConsistent/test-1/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> warningsAll
$ must-mirror target/warnings/warnings.json expect.json

0 comments on commit dc0e94b

Please sign in to comment.