Skip to content

Commit

Permalink
Store flatpak-builder-lint output as JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
barthalion committed Oct 25, 2023
1 parent 01f1421 commit 28a489a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ log = "0.4.20"
ostree = { version = "0.19.1", features = ["v2021_5"] }
reqwest = { version = "0.11.22", features = ["json", "blocking"] }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
serde_json = { version = "1.0.107", features = ["raw_value"] }
2 changes: 1 addition & 1 deletion src/review/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum DiagnosticInfo {
/// The appstream file is missing or couldn't be read.
FailedToLoadAppstream { path: String, error: String },
/// There is a problem in one of the appstream files.
FlatpakBuilderLint { stdout: String, stderr: String },
FlatpakBuilderLint { stdout: serde_json::value::Value, stderr: String },
/// The app is FOSS, but a URL for the build's CI log was not given or is not a valid URL.
MissingBuildLogUrl,
/// A screenshot in appstream does not point to the flathub screenshot mirror.
Expand Down
2 changes: 1 addition & 1 deletion src/review/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn run_flatpak_builder_lint(refstring: &str) -> Result<Vec<ValidationDiagnostic>
if !output.status.success() {
Ok(vec![ValidationDiagnostic::new(
DiagnosticInfo::FlatpakBuilderLint {
stdout: String::from_utf8_lossy(&output.stdout).to_string(),
stdout: serde_json::from_slice::<serde_json::Value>(&output.stdout).unwrap(),
stderr: String::from_utf8_lossy(&output.stderr).to_string(),
},
Some(refstring.to_string()),
Expand Down

0 comments on commit 28a489a

Please sign in to comment.