The fix
command attempts to automatically fix WDL files with the following specification incompatibilities:
String
/non-String
concatenations are re-written as string interpolations, .e.g.becomesruntime { disks: "local-disk " + disk_size_gb + " SSD" }
runtime { disks: "local-disk ${disk_size_gb} SSD" }
- Declarations with type mismatches, e.g.
becomes
String x = ceil(size(myfile))
Int x = ceil(size(myfile))
Additional fixes will be added as needed. Please request them by opening an issue.
- Re-usage of variable names within the same scope, e.g.
task bad_juju { input { String foo } ... output { Int foo } }
- Coercions from
String
to non-String
values are allowed within the context ofread_*
return values, but not otherwise. For example, this is legal:but this is illegal:task ok { command <<< echo "1\n2\n3" > ints.txt >>> output { Array[Int] ints = read_lines("ints.txt") } }
workflow not_ok { call ints_to_strings output { Array[Int] ints = ints_to_strings.strings } } task ints_to_strings { command <<< echo "1\n2\n3" > ints.txt >>> output { Array[String] strings = read_lines("ints.txt") } }
$ java -jar target/wdlTools.jar fix -O gatk-fixed https://raw.githubusercontent.com/gatk-workflows/gatk4-genome-processing-pipeline/1.3.0/WholeGenomeGermlineSingleSample.wdl
Usage: wdlTools fix [OPTIONS] <path|uri>
Fix specification incompatibilities in WDL file and all its dependencies.
Options:
-a, --antlr4-trace enable trace logging of the ANTLR4 parser
-f, --follow-imports (Default) format imported files in addition to the
main file
--nofollow-imports only format the main file
-l, --local-dir <arg>... directory in which to search for imports; ignored
if --nofollow-imports is specified
-O, --output-dir <arg> Directory in which to output fixed WDL files;
defaults to current directory
-o, --overwrite Overwrite existing files
--nooverwrite (Default) Do not overwrite existing files
-q, --quiet use less verbose output
-s, --src-version <arg> WDL version of the document being upgraded
-v, --verbose use more verbose output
-h, --help Show help message
trailing arguments:
uri (required) path or String (file:// or http(s)://) to the main WDL file