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 docuement 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/wdl repository. Note that the information may be out of sync with released packages.

§Analysis Rules

NameDescription
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 document::Document;

Modules§

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.
Config
Configuration for wdl-analysis.
Diagnostics
Represents a collection of validation diagnostics.
DiagnosticsConfig
Configuration for analysis diagnostics.
IncrementalChange
Represents an incremental change to a document.
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.

Constants§

EXCEPT_COMMENT_PREFIX
The prefix of except comments.
UNNECESSARY_FUNCTION_CALL
The rule identifier for unnecessary function call warnings.
UNUSED_CALL_RULE_ID
The rule identifier for unused call warnings.
UNUSED_DECL_RULE_ID
The rule identifier for unused declaration warnings.
UNUSED_IMPORT_RULE_ID
The rule identifier for unused import warnings.
UNUSED_INPUT_RULE_ID
The rule identifier for unused input warnings.
USING_FALLBACK_VERSION
The rule identifier for unsupported version fallback warnings.

Traits§

Rule
A trait implemented by analysis rules.
SyntaxNodeExt
An extension trait for syntax nodes.
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.