Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format sub command errors on instantiation of structs #216

Open
wholtz opened this issue Mar 24, 2022 · 1 comment
Open

format sub command errors on instantiation of structs #216

wholtz opened this issue Mar 24, 2022 · 1 comment

Comments

@wholtz
Copy link

wholtz commented Mar 24, 2022

$ cat example.wdl
version 1.0

struct Message {
   String text
   Int priority
}

workflow my_workflow {
  input {
    String text
    Int priority
  }

  Message alert = {
    "text": text,
    "priority": priority
  }
}
$ wdltools check example.wdl 
$ wdltools format example.wdl 
[error] Command scallop failed
java.lang.Exception: Unrecognized type TypeIdentifier(Message)
        at wdlTools.generators.code.WdlFormatter$DataType$.fromWdlType(WdlFormatter.scala:825)
        at wdlTools.generators.code.WdlFormatter$DeclarationBase.<init>(WdlFormatter.scala:1231)
        at wdlTools.generators.code.WdlFormatter$DeclarationStatement.<init>(WdlFormatter.scala:1250)
        at wdlTools.generators.code.WdlFormatter$DeclarationStatement$.apply(WdlFormatter.scala:1249)
        at wdlTools.generators.code.WdlFormatter$DeclarationStatement$.apply(WdlFormatter.scala:1249)
        at scala.collection.immutable.Vector1.map(Vector.scala:1872)
        at scala.collection.immutable.Vector1.map(Vector.scala:375)
        at wdlTools.generators.code.WdlFormatter$DeclarationsSection.<init>(WdlFormatter.scala:1254)
        at wdlTools.generators.code.WdlFormatter.wdlTools$generators$code$WdlFormatter$$splitWorkflowElements(WdlFormatter.scala:1498)
        at wdlTools.generators.code.WdlFormatter$WorkflowSections.<init>(WdlFormatter.scala:1616)
        at wdlTools.generators.code.WdlFormatter$WorkflowBlock.body(WdlFormatter.scala:1656)
        at wdlTools.generators.code.WdlFormatter$BlockStatement.<init>(WdlFormatter.scala:1272)
        at wdlTools.generators.code.WdlFormatter$WorkflowBlock.<init>(WdlFormatter.scala:1652)
        at wdlTools.generators.code.WdlFormatter$DocumentSections.format(WdlFormatter.scala:1873)
        at wdlTools.generators.code.WdlFormatter.formatElement(WdlFormatter.scala:1898)
        at wdlTools.generators.code.WdlFormatter.formatDocument(WdlFormatter.scala:1907)
        at wdlTools.generators.code.WdlFormatter.$anonfun$formatDocuments$1(WdlFormatter.scala:1914)
        at wdlTools.syntax.WdlParser$Walker.addDocument$1(WdlParser.scala:66)
        at wdlTools.syntax.WdlParser$Walker.walk(WdlParser.scala:80)
        at wdlTools.generators.code.WdlFormatter.formatDocuments(WdlFormatter.scala:1913)
        at wdlTools.cli.Format.apply(Format.scala:15)
        at wdlTools.cli.Main$.runCommand(Main.scala:36)
        at wdlTools.cli.Main$.delayedEndpoint$wdlTools$cli$Main$1(Main.scala:48)
        at wdlTools.cli.Main$delayedInit$body.apply(Main.scala:12)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1(App.scala:76)
        at scala.App.$anonfun$main$1$adapted(App.scala:76)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:926)
        at scala.App.main(App.scala:76)
        at scala.App.main$(App.scala:74)
        at wdlTools.cli.Main$.main(Main.scala:12)
        at wdlTools.cli.Main.main(Main.scala)

$ 
@tweep
Copy link

tweep commented May 7, 2023

Great tool, thank you ! However I ran into the same issue when trying to reformat some code - a fix would be much appreciated. I tried a few older versions, look like this never was implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants