File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/main/scala/codacy/dockerApi Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ abstract class DockerEngine(Tool: Tool) {
11
11
spec.flatMap { implicit spec =>
12
12
config.flatMap { case maybeConfig =>
13
13
// search for our config
14
- val maybePatterns = maybeConfig.flatMap(_.tools.collectFirst { case config if config.name == spec.name => config.patterns })
14
+ val maybePatterns = maybeConfig.flatMap(_.tools.collectFirst { case config if config.name == spec.name =>
15
+ val allPatternIds = spec.patterns.map(_.patternId)
16
+ config.patterns.filter{ case pattern => allPatternIds.contains(pattern.patternId) }
17
+ })
15
18
val maybeFiles = maybeConfig.flatMap(_.files.map(_.map { case path =>
16
19
sourcePath.resolve(path.value)
17
20
}))
Original file line number Diff line number Diff line change @@ -65,25 +65,25 @@ package object dockerApi {
65
65
66
66
implicit def configReader (implicit spec: Spec ): Reads [FullConfig ] = {
67
67
implicit val r1 = Json .reads[ParameterDef ]
68
- implicit val r0 = Json .reads[PatternDef ].flatMap{ case pattern =>
68
+ implicit val r0 = Json .reads[PatternDef ]/* .flatMap{ case pattern =>
69
69
70
70
val filtered =
71
71
if (spec.patterns.exists(_.patternId == pattern.patternId)) JsSuccess(pattern)
72
72
else JsError(s"invalid patternId: ${pattern.patternId}")
73
73
74
74
asReader(filtered)
75
- }
75
+ }*/
76
76
77
77
implicit val r2 = Reads .set(Json .reads[ToolConfig ])
78
78
79
- Json .reads[FullConfig ].flatMap{ case fullCfg =>
79
+ Json .reads[FullConfig ]/* .flatMap{ case fullCfg =>
80
80
val ps = fullCfg.tools.collectFirst{ case tool if tool.name == spec.name =>
81
81
if(tool.patterns.isEmpty) JsError("no patterns selected")
82
82
else JsSuccess(fullCfg)
83
83
}.getOrElse(JsError(s"no config for ${spec.name} found"))
84
84
85
85
asReader(ps)
86
- }
86
+ }*/
87
87
}
88
88
89
89
implicit lazy val writer : Writes [Result ] = {
You can’t perform that action at this time.
0 commit comments