Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement WDL 1.2 task evaluation. #265

Merged
merged 11 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ rowan = "0.15.15"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.120"
serde_with = "3.8.1"
sysinfo = "0.32.1"
tempfile = "3.10.1"
tokio = { version = "1.38.0", features = ["full"] }
toml = "0.8.14"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ The `wdl` CLI tool currently supports the following subcommands:
- `format` - Parses, validates, and then formats a single WDL document, printing
the result to STDOUT.
- `doc` - Builds documentation for a WDL workspace.
- `run` - Parses, validates, and then runs a workflow or task from a single WDL
document using a local (i.e. not in a container) executor.

Each of the subcommands supports passing `-` as the file path to denote reading
from STDIN instead of a file on disk.
Expand Down
13 changes: 4 additions & 9 deletions gauntlet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub use repository::Repository;
use wdl::analysis::Analyzer;
use wdl::analysis::rules;
use wdl::ast::Diagnostic;
use wdl::ast::SyntaxNode;
use wdl::lint::LintVisitor;
use wdl::lint::ast::Validator;

Expand Down Expand Up @@ -198,7 +197,7 @@ pub async fn gauntlet(args: Args) -> Result<()> {
total_time += elapsed;

for result in &results {
let path = result.uri().to_file_path().ok();
let path = result.document().uri().to_file_path().ok();
let path = match &path {
Some(path) => path
.strip_prefix(&repo_root)
Expand All @@ -211,20 +210,16 @@ pub async fn gauntlet(args: Args) -> Result<()> {
let document_identifier =
document::Identifier::new(repository_identifier.clone(), &path);

let diagnostics: Cow<'_, [Diagnostic]> = match result.parse_result().error() {
let diagnostics: Cow<'_, [Diagnostic]> = match result.error() {
Some(e) => {
vec![Diagnostic::error(format!("failed to read `{path}`: {e:#}"))].into()
}
None => result.diagnostics().into(),
None => result.document().diagnostics().into(),
};

let mut actual = IndexSet::new();
if !diagnostics.is_empty() {
let source = result
.parse_result()
.root()
.map(|n| SyntaxNode::new_root(n.clone()).text().to_string())
.unwrap_or(String::new());
let source = result.document().node().syntax().text().to_string();

let file: SimpleFile<_, _> = SimpleFile::new(
Path::new(document_identifier.path())
Expand Down
5 changes: 5 additions & 0 deletions wdl-analysis/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Refactored the `AnalysisResult` and `Document` types to move properties of
the former into the latter; this will assist in evaluation of documents in
that the `Document` alone can be passed into evaluation ([#265](https://github.com/stjude-rust-labs/wdl/pull/265)).
* Removed the "optional type" constraint for the `select_first`, `select_all`,
and `defined` functions; instead, these functions now accepted non-optional
types and analysis emits a warning when the functions are called with
Expand All @@ -35,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* Fixed an issue where imported structs weren't always checked correctly for
type equivalence with local structs ([#265](https://github.com/stjude-rust-labs/wdl/pull/265)).
* Common type calculation now supports discovering common types between the
compound types containing Union and None as inner types, e.g.
`Array[String] | Array[None] -> Array[String?]` ([#257](https://github.com/stjude-rust-labs/wdl/pull/257)).
Expand Down
Loading
Loading