remove yaml reports

This commit is contained in:
ThetaDev 2022-09-19 00:24:16 +02:00
parent 972288d810
commit 254c3885dc
3 changed files with 5 additions and 14 deletions

View file

@ -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"]}

3
Justfile Normal file
View file

@ -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;

View file

@ -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(())
}
}