Skip to content

Commit f6c134b

Browse files
Merge pull request #2 from amitmiran137/patch-1
Upgrade to new dialect in scala.meta
2 parents a295730 + 64ae095 commit f6c134b

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@ jobs:
2727
exit 0
2828
fi
2929
30-
30+
run-scala-cli-tests:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: VirtusLab/scala-cli-setup@main
35+
- name: Run tests
36+
run: scala-cli test .

resources/test.scala_test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22

33
import java.io.Serializable
4+
import scala.io.Source as src
45

56
@Serializable
67
case class TestClass1(field1: String, field2: Int){
7-
8+
src.DefaultBufSize.toString
89
}
910

1011
@SomeAnnotation
@@ -21,4 +22,4 @@ case class TestClass4(field7: String, field8: Int)
2122
@deriving(SomeAnnotation, SomeOtherAnnotation, Reader, Writer)
2223
case class TestClass5(field9: Double, field10: Boolean = true){
2324

24-
}
25+
}

src/FileParser.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.meta._
2+
23
case class ScalaFile(
34
imports: List[String],
45
classes: List[ClassInfo],
@@ -45,7 +46,8 @@ object FileParser {
4546

4647
def parse(content: String): ScalaFile = {
4748
val input = Input.String(content)
48-
val exampleTree: Source = input.parse[Source].get
49+
val dialect = dialects.Scala213Source3
50+
val exampleTree: Source = dialect(input).parse[Source].get
4951

5052
val tree =
5153
parseTreeClasses(exampleTree)

test/BreakingChangeDetector.test.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class BreakingChangeDetectorTest extends munit.FunSuite {
33
val oldFile = Thread
44
.currentThread()
55
.getContextClassLoader
6-
.getResource("V1.scala_test")
6+
.getResource("v1.scala_test")
77
.getPath
88
val oldFileParsed = FileParser.fromPathToClassDef(oldFile)
99
val newFile = Thread
@@ -23,7 +23,7 @@ class BreakingChangeDetectorTest extends munit.FunSuite {
2323
val oldFile = Thread
2424
.currentThread()
2525
.getContextClassLoader
26-
.getResource("V1.scala_test")
26+
.getResource("v1.scala_test")
2727
.getPath
2828
val oldFileParsed = FileParser.fromPathToClassDef(oldFile)
2929
val newFile = Thread
@@ -84,7 +84,7 @@ class BreakingChangeDetectorTest extends munit.FunSuite {
8484
val oldFile = Thread
8585
.currentThread()
8686
.getContextClassLoader
87-
.getResource("V1.scala_test")
87+
.getResource("v1.scala_test")
8888
.getPath
8989
val oldFileParsed = FileParser.fromPathToClassDef(oldFile)
9090
val newFile = Thread

0 commit comments

Comments
 (0)