dnanexus / wdlTools

WDL tools for parsing, type-checking, and more
Apache License 2.0
25 stars 7 forks source link

Inconsistent output from wdltools format #215

Open wholtz opened 2 years ago

wholtz commented 2 years ago

I'm trying to use wdltools format in continuous integration testing, in order to verify that the WDL file has been properly formatted. I've noticed that the output of

wdltools format test.wdl

generates a trailing newline, while

wdltools format --overwrite test.wdl

does not generate a file with a trailing newline. I would like to see the wdltools format output be independent of the --overwrite flag setting.

$ wdltools format --overwrite test.wdl
$ diff test.wdl <(wdltools format test.wdl)
0a1
> test.wdl
22c23
< }
\ No newline at end of file
---
> }
$ cat test.wdl
version 1.0

workflow my_workflow {
  input {
    String message
  }

  call display {
    input:
      message = message
  }
}

task display {
  input {
    String message
  }

  command <<<
    printf '~{message}'
  >>>
}$ wdltools format test.wdl
test.wdl
version 1.0

workflow my_workflow {
  input {
    String message
  }

  call display {
    input:
      message = message
  }
}

task display {
  input {
    String message
  }

  command <<<
    printf '~{message}'
  >>>
}
$