Commit 9538cd68 authored by Jens Korinth's avatar Jens Korinth
Browse files

Fixes #114 - scalastyle issues

* fixed new issues; old scalastyle problems persist
* postponed fixing old issues
parent 55d68dd8
Pipeline #65 passed with stage
in 3 minutes
......@@ -4,6 +4,7 @@ import de.tu_darmstadt.cs.esa.tapasco.task._
import de.tu_darmstadt.cs.esa.tapasco.Logging._
import de.tu_darmstadt.cs.esa.tapasco.filemgmt.FileAssetManager
// scalastyle:off structural.type
package object executors {
trait Executor[-A] { def execute(a: A)(implicit cfg: Configuration, tsk: Tasks): Boolean }
......@@ -25,23 +26,24 @@ package object executors {
})
private def checkPlatforms(j: { def platforms: Set[Platform] })(implicit logger: Logger) =
if (j.platforms.isEmpty) {
j.platforms.nonEmpty || {
logger.error("no valid Platforms selected! (available: %s)".format(FileAssetManager.entities.platforms map (_.name) mkString ", "))
false
} else true
}
private def checkArchs(j: { def architectures: Set[Architecture] })(implicit logger: Logger) =
if (j.architectures.isEmpty) {
j.architectures.nonEmpty || {
logger.error("no valid Architectures selected! (available: %s)".format(FileAssetManager.entities.architectures map (_.name) mkString ", "))
false
} else true
}
private def checkKernels(j: { def kernels: Set[Kernel] })(implicit logger: Logger) =
if (j.kernels.isEmpty) {
j.kernels.nonEmpty || {
logger.error("no valid Kernels selected! (available: %s)".format(FileAssetManager.entities.kernels map (_.name) mkString ", "))
false
} else { logger.info(s"${j.kernels}"); true}
}
// scalastyle:off cyclomatic.complexity
def check(j: Job)(implicit cfg: Configuration, logger: Logger): Boolean = j match {
case cj: ComposeJob => checkPlatforms(cj) && checkArchs(cj)
case cj: CoreStatisticsJob => checkPlatforms(cj) && checkArchs(cj)
......@@ -50,4 +52,6 @@ package object executors {
case ij: ImportJob => checkPlatforms(ij) && checkArchs(ij)
case _ => true
}
// scalastyle:on cyclomatic.complexity
}
// scalastyle:on structural.type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment