Expand description
Lint rules for Workflow Description Language (WDL) documents.
§Rules
This table documents all implemented wdl
lint rules implemented on the main
branch of the stjude-rust-labs/wdl
repository. Note that the information may
be out of sync with released packages.
§Lint Rules
Name | Tags | Description |
---|---|---|
CallInputSpacing | Clarity, Spacing, Style | Ensures proper spacing for call inputs |
CommandSectionIndentation | Clarity, Correctness, Spacing | Ensures consistent indentation (no mixed spaces/tabs) within command sections. |
CommentWhitespace | Spacing | Ensures that comments are properly spaced. |
ConciseInput | Style | Ensures concise input assignments are used (implicit binding when available). |
ConsistentNewlines | Clarity, Style | Ensures that \n or \r\n newlines are used consistently within the file. |
ContainerUri | Clarity, Portability | Ensures that the value for the container key in runtime /requirements sections is well-formed. |
DeclarationName | Naming | Ensures declaration names do not redundantly include their type name. |
DeprecatedObject | Deprecated | Ensures that the deprecated Object construct is not used. |
DeprecatedPlaceholder | Deprecated | Ensures that the deprecated placeholder options construct is not used. |
DoubleQuotes | Clarity, Style | Ensures that strings are defined using double quotes. |
ElementSpacing | Spacing | Ensures proper blank space between elements |
EndingNewline | Spacing, Style | Ensures that documents end with a single newline character. |
ExpectedRuntimeKeys | Completeness, Deprecated | Ensures that runtime sections have the appropriate keys. |
ExpressionSpacing | Spacing | Ensures that expressions are properly spaced. |
HereDocCommands | Clarity | Ensures that tasks use heredoc syntax in command sections. |
ImportPlacement | Clarity, Sorting | Ensures that imports are placed between the version statement and any document items. |
ImportSorted | Clarity, Style | Ensures that imports are sorted lexicographically. |
ImportWhitespace | Clarity, Spacing, Style | Ensures that there is no extraneous whitespace between or within imports. |
InputName | Naming | Ensures input names are meaningful (e.g., not generic like ‘input’, ‘in’, or too short). |
InputSorted | Clarity, Sorting, Style | Ensures that input declarations are sorted |
KnownRules | Clarity | Ensures only known rules are used in lint directives. |
LineWidth | Clarity, Spacing, Style | Ensures that lines do not exceed a certain width. |
LintDirectiveFormatted | Clarity, Correctness | Ensures lint directives are correctly formatted. |
LintDirectiveValid | Clarity, Correctness | Ensures lint directives are placed correctly to have the intended effect. |
MatchingOutputMeta | Completeness | Ensures that each output field is documented in the meta section under meta.outputs . |
MetaDescription | Completeness | Ensures the meta section contains a description key. |
MetaKeyValueFormatting | Style | Ensures that metadata objects and arrays are properly spaced. |
MetaSections | Clarity, Completeness | Ensures that tasks and workflows have the required meta and parameter_meta sections. |
OutputName | Naming | Ensures output names are meaningful (e.g., not generic like ‘output’, ‘out’, or too short). |
ParameterMetaMatched | Completeness, Sorting | Ensures that inputs have a matching entry in a parameter_meta section. |
PascalCase | Clarity, Naming, Style | Ensures that structs are defined with PascalCase names. |
PreambleCommentPlacement | Clarity | Ensures that documents have correct comments in the preamble. |
PreambleFormatted | Clarity, Spacing, Style | Ensures that documents have correct whitespace in the preamble. |
RedundantNone | Style, Clarity | Ensures optional inputs don’t have redundant None assignments. |
RequirementsSection | Completeness, Portability | Ensures that >=v1.2 tasks have a requirements section. |
RuntimeSection | Completeness, Portability | Ensures that <v1.2 tasks have a runtime section. |
SectionOrdering | Sorting, Style | Ensures that sections within tasks and workflows are sorted. |
ShellCheck | Correctness, Portability | Ensures that command sections are free of shellcheck diagnostics. |
SnakeCase | Clarity, Naming, Style | Ensures that tasks, workflows, and variables are defined with snake_case names. |
TodoComment | Completeness | Ensures that TODO statements are flagged for followup. |
TrailingComma | Style | Ensures that lists and objects in meta have a trailing comma. |
VersionStatementFormatted | Style | Ensures the version statement is correctly formatted. |
Whitespace | Spacing, Style | Ensures that a document does not contain undesired whitespace. |
§Definitions
§Definitions
§WDL Document Structure
§Preamble
The document preamble is defined as anything before the version declaration statement and the version declaration statement itself. Only comments and whitespace are permitted before the version declaration.
§Comment Types
§Lint Directives
Lint directives are special comments that begin with #@ except:
followed by a comma-delimited list of rule IDs. These comments are used to disable specific lint rules for a section of the document. When a lint directive is encountered in the preamble, it will disable the specified rules for the entire document.
For example:
#@ except: LineWidth, CommentWhitespace
§Preamble Comments
Preamble comments are special comments at the start of a WDL file that begin with double pound signs (##
). These comments are used for documentation that doesn’t fit within any of the WDL-defined documentation elements (i.e., meta
and parameter_meta
sections). They may provide context for a collection of tasks or structs, or they may provide a high-level overview of a workflow. Preamble comments can be formatted as Markdown text.
For example:
## # FlagFilter
##
## A struct to represent the filtering flags used in various `samtools` commands.
§Examples
An example of parsing a WDL document and linting it:
use wdl_lint::Linter;
use wdl_lint::analysis::Validator;
use wdl_lint::analysis::document::Document;
let mut validator = Validator::default();
validator.add_visitor(Linter::default());
Re-exports§
pub use wdl_analysis as analysis;
pub use wdl_ast as ast;
Modules§
- rules
- Module for the lint rules.
Structs§
- Linter
- A visitor that runs linting rules.
- TagSet
- A set of lint tags.
- Unknown
TagError - An error for when an unknown tag is encountered.
Enums§
- Tag
- A lint rule tag.
Constants§
- DEFINITIONS_
TEXT - The definitions of WDL concepts and terminology used in the linting rules.
Traits§
- Rule
- A trait implemented by lint rules.
Functions§
- find_
nearest_ rule - Finds the nearest rule ID to the given unknown rule ID,
or
None
if no rule ID is close enough. - rules
- Gets the default rule set.