Skip to content

Commit d361fe6

Browse files
committed
simplified interface signature, added srcRoot
1 parent eaf0b47 commit d361fe6

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

src/main/scala/org/polystat/cli/EOAnalyzer.scala

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
package org.polystat.cli
22

3-
import org.polystat.odin.analysis.EOOdinAnalyzer
4-
import org.polystat.odin.analysis.EOOdinAnalyzer.OdinAnalysisResult
5-
import org.polystat.odin.analysis.ASTAnalyzer
6-
import org.polystat.odin.parser.EoParser.sourceCodeEoParser
7-
import fs2.io.file.Files
3+
import cats.effect.IO
84
import cats.effect.Sync
95
import cats.syntax.all.*
6+
import fs2.io.file.Files
107
import fs2.io.file.Path
11-
import cats.effect.IO
8+
import org.polystat.odin.analysis.ASTAnalyzer
9+
import org.polystat.odin.analysis.EOOdinAnalyzer
10+
import org.polystat.odin.analysis.EOOdinAnalyzer.OdinAnalysisResult
1211
import org.polystat.odin.analysis.liskov.Analyzer
12+
import org.polystat.odin.parser.EoParser.sourceCodeEoParser
1313

1414
trait EOAnalyzer:
1515
def ruleId: String
16-
def analyze(tmpDir: Path)(pathToCode: Path)(
17-
code: String
16+
def analyze(
17+
tmpDir: Path,
18+
pathToSrcRoot: Path,
19+
pathToCode: Path,
20+
code: String,
1821
): IO[OdinAnalysisResult]
1922

2023
object EOAnalyzer:
@@ -42,8 +45,11 @@ object EOAnalyzer:
4245

4346
def ruleId: String = _ruleId
4447
def analyze(
45-
tmpDir: Path
46-
)(pathToCode: Path)(code: String): IO[OdinAnalysisResult] =
48+
tmpDir: Path,
49+
pathToSrcRoot: Path,
50+
pathToCode: Path,
51+
code: String,
52+
): IO[OdinAnalysisResult] =
4753
EOOdinAnalyzer
4854
.analyzeSourceCode(a)(code)(cats.Monad[IO], sourceCodeEoParser[IO](2))
4955
.map {
@@ -56,7 +62,15 @@ object EOAnalyzer:
5662

5763
def farEOAnalyzer(_ruleId: String): EOAnalyzer = new EOAnalyzer:
5864
def ruleId: String = _ruleId
59-
def analyze(tmpDir: Path)(pathToCode: Path)(
60-
code: String
65+
def analyze(
66+
tmpDir: Path,
67+
pathToSrcRoot: Path,
68+
pathToCode: Path,
69+
code: String,
6170
): IO[OdinAnalysisResult] =
62-
Far.analyze(ruleId)(tmpDir)(pathToCode)
71+
Far.analyze(
72+
ruleId = ruleId,
73+
pathToSrcRoot = pathToSrcRoot,
74+
pathToTmpDir = tmpDir,
75+
pathToCode = pathToCode,
76+
)

0 commit comments

Comments
 (0)