forked from broadinstitute/cromwell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding line numbers to workflow definitions (broadinstitute#4938)
Add line numbers to workflow definitions (broadinstitute#4938)
- Loading branch information
Showing
19 changed files
with
190 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
wdl/model/draft3/src/main/scala/wdl/model/draft3/elements/LanguageElement.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
package wdl.model.draft3.elements | ||
import wom.SourceFileLocation | ||
|
||
trait LanguageElement | ||
trait LanguageElement { | ||
val srcLoc : Option[SourceFileLocation] = None | ||
} |
4 changes: 3 additions & 1 deletion
4
wdl/model/draft3/src/main/scala/wdl/model/draft3/elements/WorkflowDefinitionElement.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package wdl.model.draft3.elements | ||
import wom.SourceFileLocation | ||
|
||
final case class WorkflowDefinitionElement(name: String, | ||
inputsSection: Option[InputsSectionElement], | ||
graphElements: Set[WorkflowGraphElement], | ||
outputsSection: Option[OutputsSectionElement], | ||
metaSection: Option[MetaSectionElement], | ||
parameterMetaSection: Option[ParameterMetaSectionElement]) extends FileBodyElement | ||
parameterMetaSection: Option[ParameterMetaSectionElement], | ||
override val srcLoc : Option[SourceFileLocation]) extends FileBodyElement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
.../src/main/scala/wdl/transforms/draft2/wdlom2wom/WdlDraft2WomWorkflowDefinitionMaker.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
package wdl.transforms.draft2.wdlom2wom | ||
|
||
import common.validation.ErrorOr.ErrorOr | ||
import wdl.draft2.model.WdlWorkflow | ||
import wdl.draft2.model.{Scope, WdlWorkflow} | ||
import wdl.draft2.model.{AstTools, Scope, WdlWorkflow} | ||
import wdl.draft2.parser.WdlParser.Terminal | ||
import wom.callable.WorkflowDefinition | ||
import wom.transforms.WomWorkflowDefinitionMaker | ||
import wom.transforms.WomGraphMaker.ops._ | ||
import wom.SourceFileLocation | ||
|
||
object WdlDraft2WomWorkflowDefinitionMaker extends WomWorkflowDefinitionMaker[WdlWorkflow] { | ||
override def toWomWorkflowDefinition(wdlWorkflow: WdlWorkflow, isASubworkflow: Boolean): ErrorOr[WorkflowDefinition] = { | ||
// NB: We don't allow "OuterGraphInputNode"s when building this (the Map is empty), so preserveScatterForExternalLookups isn't ever actually used. | ||
|
||
// Figure out the start line of the workflow in the source file | ||
val t: Terminal = AstTools.findTerminals(wdlWorkflow.ast).head | ||
|
||
(wdlWorkflow: Scope).toWomGraph(Set.empty, Map.empty, preserveIndexForOuterLookups = true, isASubworkflow: Boolean) map { wg => | ||
WorkflowDefinition( | ||
wdlWorkflow.fullyQualifiedName, | ||
wg, | ||
wdlWorkflow.meta, | ||
wdlWorkflow.parameterMeta) | ||
wdlWorkflow.parameterMeta, | ||
Some(SourceFileLocation(t.getLine))) | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
wdl/transforms/draft3/src/test/cases/cmd_whitespace_spaces.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
version 1.0 | ||
|
||
|
||
|
||
|
||
|
||
|
||
workflow Test { | ||
|
||
call Echo as echo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
version 1.0 | ||
|
||
|
||
|
||
workflow simple_conditional { | ||
Boolean bool = true | ||
|
||
|
Oops, something went wrong.