Skip to content

Commit

Permalink
feat: adds wdl-grammar gauntlet for testing grammar parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Nov 13, 2023
1 parent b713131 commit d2e13b1
Show file tree
Hide file tree
Showing 34 changed files with 4,813 additions and 874 deletions.
1,970 changes: 1,849 additions & 121 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ license = "MIT OR Apache-2.0"
edition = "2021"

[workspace.dependencies]
clap = { version = "4.4.7", features = ["derive"] }
env_logger = "0.10.0"
indexmap = { version = "2.1.0", features = ["serde"] }
log = "0.4.20"
pest = { version = "2.7.5", features = ["pretty-print"] }
pest_derive = "2.7.5"
serde = { version = "1", features = ["derive"] }
serde_with = { version = "3.4.0" }
toml = "0.8.8"
47 changes: 47 additions & 0 deletions Gauntlet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version = "v1"

[[repositories]]
organization = "PacificBiosciences"
name = "HiFi-human-WGS-WDL"

[[repositories]]
organization = "biowdl"
name = "tasks"

[[repositories]]
organization = "stjudecloud"
name = "workflows"

[[repositories]]
organization = "chanzuckerberg"
name = "czid-workflows"

[[ignored_errors]]
document = "biowdl/tasks:bedtools.wdl"
error = """
--> 29:67
|
29 | String memory = \"~{512 + ceil(size([inputBed, faidx], \"MiB\"))}MiB\"
| ^---
|
= expected WHITESPACE or OPTION"""

[[ignored_errors]]
document = "biowdl/tasks:bowtie.wdl"
error = """
--> 40:58
|
40 | String memory = \"~{5 + ceil(size(indexFiles, \"GiB\"))}GiB\"
| ^---
|
= expected WHITESPACE or OPTION"""

[[ignored_errors]]
document = "stjudecloud/workflows:template/task-templates.wdl"
error = """
--> 17:25
|
17 | Int memory_gb = <>
| ^---
|
= expected WHITESPACE, COMMENT, or expression"""
44 changes: 38 additions & 6 deletions wdl-grammar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,41 @@ edition.workspace = true
license.workspace = true

[dependencies]
clap = { version = "4.4.6", features = ["derive"] }
env_logger.workspace = true
log.workspace = true
pest = "2.7.5"
pest_derive = "2.7.5"
serde.workspace = true
async-recursion = { version = "1.0.5", optional = true }
chrono = { version = "0.4.31", optional = true }
clap = { workspace = true, optional = true }
colored = { version = "2.0.4", optional = true }
dirs = { version = "5.0.1", optional = true }
env_logger = { workspace = true, optional = true }
indexmap = { workspace = true, optional = true }
log = { workspace = true, optional = true }
octocrab = { version = "0.32.0", optional = true }
pest = { workspace = true }
pest_derive = { workspace = true }
reqwest = { version = "0.11.22", optional = true }
serde = { workspace = true }
serde_with = { workspace = true, optional = true }
tokio = { version = "1.33.0", features = ["full"], optional = true}
toml = { workspace = true, optional = true }

[features]
binaries = [
"async-recursion",
"chrono",
"clap",
"colored",
"dirs",
"env_logger",
"indexmap",
"log",
"octocrab",
"reqwest",
"serde_with",
"tokio",
"toml"
]

[[bin]]
name = "wdl-grammar"
path = "src/main.rs"
required-features = ["binaries"]
146 changes: 0 additions & 146 deletions wdl-grammar/src/bin/wdl-grammar-create-test.rs

This file was deleted.

14 changes: 13 additions & 1 deletion wdl-grammar/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
//! A crate for lexing and parsing the Workflow Description Language
//! (WDL) using [`pest`](https://pest.rs).
#![feature(let_chains)]
#![warn(rust_2018_idioms)]
#![warn(rust_2021_compatibility)]
#![warn(missing_debug_implementations)]
#![deny(rustdoc::broken_intra_doc_links)]

#[cfg(feature = "binaries")]
use clap::ValueEnum;
use serde::Deserialize;
use serde::Serialize;

pub mod v1;

#[derive(Clone, Debug, Default, Serialize, ValueEnum)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[cfg_attr(feature = "binaries", derive(ValueEnum))]
#[serde(rename_all = "lowercase")]
pub enum Version {
/// Version 1.x of the WDL specification.
#[default]
V1,
}

impl std::fmt::Display for Version {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Version::V1 => write!(f, "WDL v1.x"),
}
}
}
Loading

0 comments on commit d2e13b1

Please sign in to comment.