Crate wdl_lint

Source
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

NameTagsDescription
BlankLinesBetweenElementsSpacingEnsures proper blank space between elements
CallInputSpacingStyle, Clarity, SpacingEnsures proper spacing for call inputs
CommandSectionMixedIndentationClarity, Correctness, SpacingEnsures that lines within a command do not mix spaces and tabs.
CommentWhitespaceSpacingEnsures that comments are properly spaced.
ContainerValueClarity, PortabilityEnsures that the value for container keys in runtime/requirements sections are well-formed.
DeprecatedObjectDeprecatedEnsures that the deprecated Object construct is not used.
DeprecatedPlaceholderOptionDeprecatedEnsures that the deprecated placeholder options construct is not used.
DescriptionMissingCompletenessEnsures that each meta section has a description key.
DisallowedInputNameNamingEnsures that input names are meaningful.
DisallowedOutputNameNamingEnsures that output names are meaningful.
DoubleQuotesClarity, StyleEnsures that strings are defined using double quotes.
EndingNewlineSpacing, StyleEnsures that documents end with a single newline character.
ExpressionSpacingSpacingEnsures that expressions are properly spaced.
ImportPlacementClarity, SortingEnsures that imports are placed between the version statement and any document items.
ImportSortClarity, StyleEnsures that imports are sorted lexicographically.
ImportWhitespaceClarity, Style, SpacingEnsures that there is no extraneous whitespace between or within imports.
InconsistentNewlinesClarity, StyleEnsures that newlines are used consistently within the file.
InputSortingStyleEnsures that input declarations are sorted
KeyValuePairsStyleEnsures that metadata objects and arrays are properly spaced.
LineWidthClarity, Spacing, StyleEnsures that lines do not exceed a certain width.
MalformedLintDirectiveClarity, CorrectnessEnsures there are no malformed lint directives.
MatchingParameterMetaCompletenessEnsures that inputs have a matching entry in a parameter_meta section.
MisplacedLintDirectiveClarity, CorrectnessEnsures there are no misplaced lint directives.
MissingMetasCompleteness, ClarityEnsures that tasks have both a meta and a parameter_meta section.
MissingOutputCompleteness, PortabilityEnsures that tasks have an output section.
MissingRequirementsCompleteness, PortabilityEnsures that >=v1.2 tasks have a requirements section.
MissingRuntimeCompleteness, PortabilityEnsures that tasks have a runtime section.
NonmatchingOutputCompletenessEnsures that each output field is documented in the meta section under meta.outputs.
NoCurlyCommandsClarityEnsures that tasks use heredoc syntax in command sections.
PascalCaseClarity, Naming, StyleEnsures that structs are defined with PascalCase names.
PreambleCommentAfterVersionClarityEnsures that documents have correct comments in the preamble.
PreambleFormattingSpacing, Style, ClarityEnsures that documents have correct whitespace in the preamble.
RuntimeSectionKeysCompleteness, DeprecatedEnsures that runtime sections have the appropriate keys.
RedundantInputAssignmentStyleEnsures that redundant input assignments are shortened
SectionOrderingSorting, StyleEnsures that sections within tasks and workflows are sorted.
ShellCheckCorrectness, Portability(BETA) Ensures that command sections are free of shellcheck diagnostics.
SnakeCaseClarity, Naming, StyleEnsures that tasks, workflows, and variables are defined with snake_case names.
TodoCompletenessEnsures that TODO statements are flagged for followup.
TrailingCommaStyleEnsures that lists and objects in meta have a trailing comma.
UnknownRuleClarityEnsures there are no unknown rules present in lint directives.
VersionFormattingStyleEnsures correct formatting of the version statement
WhitespaceSpacing, StyleEnsures that a document does not contain undesired whitespace.

§Examples

An example of parsing a WDL document and linting it:

use wdl_lint::LintVisitor;
use wdl_lint::ast::Document;
use wdl_lint::ast::Validator;

let (document, diagnostics) = Document::parse(source);
if !diagnostics.is_empty() {
    // Handle the failure to parse
}

let mut validator = Validator::default();
validator.add_visitor(LintVisitor::default());
if let Err(diagnostics) = validator.validate(&document) {
    // Handle the failure to validate
}

Re-exports§

Modules§

  • Module for the lint rules.

Structs§

Enums§

  • A lint rule tag.

Constants§

Traits§

  • A trait implemented by lint rules.

Functions§