Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
9538cd68
Commit
9538cd68
authored
Dec 28, 2017
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/tapasco/jobs/executors/package.scala
View file @
9538cd68
...
...
@@ -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
.
is
Empty
)
{
j
.
platforms
.
non
Empty
||
{
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
.
is
Empty
)
{
j
.
architectures
.
non
Empty
||
{
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
.
is
Empty
)
{
j
.
kernels
.
non
Empty
||
{
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment