stjude-rust-labs / wdl

Rust crates for working with Workflow Description Language (WDL) documents.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consolidate preamble comment warnings

a-frantz opened this issue · comments

See an example of a "bad" preamble here: https://github.com/aws-samples/amazon-omics-tutorials/blob/main/example-workflows/gatk-best-practices/workflows/germline-fastqs-to-vcf/sub-workflows/fastq-to-ubam.wdl

I'm not sure who owns this code (whether it's the Broad or Amazon), but they are using double-pound sign comments the way we use them, but after the version declaration. This causes a LintWarning to be thrown for every line of "the preamble" of that file. We should update to detect a continuous preamble in the wrong location and warn once on the whole span.

A different case for the same rule: https://github.com/getwilds/ww-fastq-to-cram/blob/main/ww-fastq-to-cram.wdl

The line:

#### STRUCT DEFINITIONS

gets picked up as an out of place preamble comment.
Should we allow/ignore lines starting with triple+ pound signs? This doesn't look like what we would call a preamble comment. More importantly, this seems like a perfectly acceptable comment. See another hypothetically fine comment:

######################
# STRUCT DEFINITIONS #
######################

This would throw 2 LintWarning for line1 and line3. I'm not sure what the exact code should be, but there should be exceptions worked into the preamble rule.