diff --git a/sbt-test/FileNameConsistent/test-1/.scalafix.conf b/sbt-test/FileNameConsistent/test-1/.scalafix.conf new file mode 100644 index 0000000..4cb744e --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/.scalafix.conf @@ -0,0 +1,3 @@ +rules = [ + FileNameConsistent +] diff --git a/sbt-test/FileNameConsistent/test-1/build.sbt b/sbt-test/FileNameConsistent/test-1/build.sbt new file mode 100644 index 0000000..856724a --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/build.sbt @@ -0,0 +1 @@ +ThisBuild / scalafixDependencies += "com.github.xuwei-k" %% "scalafix-rules" % sys.props("scalafix-rules.version") diff --git a/sbt-test/FileNameConsistent/test-1/expect.json b/sbt-test/FileNameConsistent/test-1/expect.json new file mode 100644 index 0000000..dc18563 --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/expect.json @@ -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 + } +}] diff --git a/sbt-test/FileNameConsistent/test-1/project/plugins.sbt b/sbt-test/FileNameConsistent/test-1/project/plugins.sbt new file mode 100644 index 0000000..d0901b9 --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/project/plugins.sbt @@ -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") diff --git a/sbt-test/FileNameConsistent/test-1/src/main/scala/a/A.scala b/sbt-test/FileNameConsistent/test-1/src/main/scala/a/A.scala new file mode 100644 index 0000000..1f82d61 --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/src/main/scala/a/A.scala @@ -0,0 +1,3 @@ +package a + +object A diff --git a/sbt-test/FileNameConsistent/test-1/src/main/scala/a/X.scala b/sbt-test/FileNameConsistent/test-1/src/main/scala/a/X.scala new file mode 100644 index 0000000..bb00dba --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/src/main/scala/a/X.scala @@ -0,0 +1,3 @@ +package a + +class Y diff --git a/sbt-test/FileNameConsistent/test-1/test b/sbt-test/FileNameConsistent/test-1/test new file mode 100644 index 0000000..c0de808 --- /dev/null +++ b/sbt-test/FileNameConsistent/test-1/test @@ -0,0 +1,2 @@ +> warningsAll +$ must-mirror target/warnings/warnings.json expect.json