From 254c3885dce23f926ce7f04ea60f6a33ef379228 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 19 Sep 2022 00:24:16 +0200 Subject: [PATCH] remove yaml reports --- Cargo.toml | 4 ---- Justfile | 3 +++ src/report.rs | 12 ++---------- 3 files changed, 5 insertions(+), 14 deletions(-) create mode 100644 Justfile diff --git a/Cargo.toml b/Cargo.toml index 255c669..85f9e3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,9 +14,6 @@ default-tls = ["reqwest/default-tls"] rustls-tls-webpki-roots = ["reqwest/rustls-tls-webpki-roots"] rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"] -# Error reports in yaml format -report-yaml = ["serde_yaml"] - [dependencies] # quick-js = "0.4.1" quick-js = { path = "../quickjs-rs" } @@ -30,7 +27,6 @@ reqwest = {version = "0.11.11", default-features = false, features = ["json", "g tokio = {version = "1.20.0", features = ["macros", "time", "fs", "process"]} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.82" -serde_yaml = {version = "0.9.11", optional = true} serde_with = {version = "2.0.0", features = ["json"] } rand = "0.8.5" chrono = {version = "0.4.19", features = ["serde"]} diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..60cd8fb --- /dev/null +++ b/Justfile @@ -0,0 +1,3 @@ +report2yaml: + yq e -Pi rustypipe_reports/*.json + for f in rustypipe_reports/*.json; do mv $f rustypipe_reports/`basename $f .json`.yaml; done; diff --git a/src/report.rs b/src/report.rs index 795fcb3..1d30cac 100644 --- a/src/report.rs +++ b/src/report.rs @@ -77,16 +77,8 @@ impl FileReporter { } fn _report(&self, report: &Report) -> Result<()> { - #[cfg(not(feature = "report-yaml"))] - { - let report_path = get_report_path(&self.path, report, "json")?; - serde_json::to_writer_pretty(&File::create(report_path)?, &report)?; - } - #[cfg(feature = "report-yaml")] - { - let report_path = get_report_path(&self.path, report, "yaml")?; - serde_yaml::to_writer(&File::create(report_path)?, &report)?; - } + let report_path = get_report_path(&self.path, report, "json")?; + serde_json::to_writer_pretty(&File::create(report_path)?, &report)?; Ok(()) } }