@@ -3,23 +3,24 @@ package codacy.pylint
33import java .io .File
44import java .nio .file .{Files , Path }
55
6- import codacy .docker .api ._
7- import codacy .docker .api .utils .ToolHelper
8- import codacy .dockerApi .utils .{CommandRunner , FileHelper }
6+ import com .codacy .plugins .api .{ErrorMessage , Options , Source }
7+ import com .codacy .plugins .api .results .{Parameter , Pattern , Result , Tool }
8+ import com .codacy .tools .scala .seed .utils .ToolHelper ._
9+ import com .codacy .tools .scala .seed .utils .{CommandRunner , FileHelper }
910import play .api .libs .json ._
1011
1112import scala .sys .process ._
1213import scala .util .{Properties , Success , Try }
1314
1415object Pylint extends Tool {
1516
16- private val pythonVersionKey = Configuration .Key (" python_version" )
17+ private val pythonVersionKey = Options .Key (" python_version" )
1718 private val python3 = " 3"
1819
1920 def apply (source : Source .Directory , configuration : Option [List [Pattern .Definition ]], files : Option [Set [Source .File ]],
20- options : Map [Configuration .Key , Configuration .Value ])
21+ options : Map [Options .Key , Options .Value ])
2122 (implicit specification : Tool .Specification ): Try [List [Result ]] = {
22- val completeConf = ToolHelper .patternsToLint( configuration)
23+ val completeConf = configuration.withDefaultParameters
2324
2425 def isEnabled (issue : Result ) = {
2526 issue match {
@@ -65,7 +66,7 @@ object Pylint extends Tool {
6566 linesTry.map { line => line.flatMap(parseLine).flatten.filter(isEnabled) }
6667 }
6768
68- private def parseLine (line : String ) = {
69+ private def parseLine (line : String ): Option [ List [ Result ]] = {
6970 val LineRegex = """ (.*?)###(\d*?)###(.*?)###(.*?)""" .r
7071
7172 def createIssue (filename : String , lineNumber : String , message : String , patternId : String ) = {
0 commit comments