Skip to main content

Crate wdl_analysis

Crate wdl_analysis 

Source
Expand description

Analysis of Workflow Description Language (WDL) documents.

An analyzer can be used to implement the Language Server Protocol (LSP).

§Examples

use url::Url;
use wdl_analysis::Analyzer;

#[tokio::main]
async fn main() {
    let analyzer = Analyzer::default();
    // Add a document to the analyzer
    analyzer
        .add_document(Url::parse("file:///path/to/file.wdl").unwrap())
        .await
        .unwrap();
    let results = analyzer.analyze(()).await.unwrap();
    // Process the results
    for result in results {
        // Do something
    }
}

§Rules

This table documents all implemented wdl analysis rules implemented on the main branch of the stjude-rust-labs/sprocket repository. Note that the information may be out of sync with released packages.

§Analysis Rules

NameDescription
MisleadingDeclarationOrderWarns if task variable declarations appear after a command section.
UnnecessaryFunctionCallEnsures that function calls are necessary.
UnusedCallEnsures that outputs of a call statement are used in the declaring workflow.
UnusedDeclarationEnsures that private declarations in tasks or workspaces are used within the declaring task or workspace.
UnusedImportEnsures that import namespaces are used in the importing document.
UnusedInputEnsures that task or workspace inputs are used within the declaring task or workspace.

Re-exports§

pub use config::Config;
pub use config::DiagnosticsConfig;
pub use config::FeatureFlags;
pub use document::Document;

Modules§

config
Configuration for this crate.
diagnostics
Module for all diagnostic creation functions.
document
Representation of analyzed WDL documents.
eval
Representation of evaluation graphs.
handlers
Language server protocol handlers.
stdlib
Representation of WDL standard library functions.
types
Representation of the WDL type system.

Structs§

AnalysisResult
Represents the result of an analysis.
Analyzer
Represents a Workflow Description Language (WDL) document analyzer.
Diagnostics
Represents a collection of validation diagnostics.
Example
A lint rule example.
IncrementalChange
Represents an incremental change to a document.
LabeledSnippet
A labeled WDL code snippet.
MisleadingDeclarationOrderRule
Represents the using misleading declaration order rule.
SourceEdit
Represents an edit to a document’s source.
SourcePosition
Represents a position in a document’s source.
UnnecessaryFunctionCall
Represents the unnecessary call rule.
UnusedCallRule
Represents the unused call rule.
UnusedDeclarationRule
Represents the unused declaration rule.
UnusedImportRule
Represents the unused import rule.
UnusedInputRule
Represents the unused input rule.
UsingFallbackVersion
Represents the using fallback version rule.
Validator
Implements an AST validator.

Enums§

ProgressKind
Represents the kind of analysis progress being reported.
SourcePositionEncoding
Represents the encoding of a source position.
VisitReason
Represents the reason an AST node has been visited.

Statics§

ALL_RULE_IDS
All rule IDs sorted alphabetically.

Traits§

Exceptable
An extension trait for syntax nodes.
Rule
A trait implemented by analysis rules.
Visitor
A trait used to implement an AST visitor.

Functions§

path_to_uri
Converts a local file path to a file schemed URI.
rules
Gets the list of all analysis rules.