Skip to content

Commit

Permalink
crev-to-vet converter that converts a proof db into audits.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Sep 5, 2023
1 parent ade02f2 commit 36a3d61
Show file tree
Hide file tree
Showing 6 changed files with 497 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crev-data",
"crev-wot",
"crev-lib",
"crevette",
]

[workspace.package]
Expand Down
19 changes: 19 additions & 0 deletions crevette/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "crevette"
description = "Converter for using cargo-crev reviews with cargo-vet"
keywords = ["cargo-vet", "crev2vet", "cargo-crev", "exporter", "supply-chain-security"]
categories = ["development-tools"]
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[dependencies]
crev-lib.workspace = true
crev-data.workspace = true
crev-wot.workspace = true
semver.workspace = true
serde.workspace = true
toml_edit = { version = "0.19.14", features = ["serde"] }
26 changes: 26 additions & 0 deletions crevette/src/bin/crevette.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use crevette::Crevette;
use std::error::Error as _;
use std::process::ExitCode;

fn main() -> ExitCode {
match Crevette::new().and_then(|c| c.convert_into_repo()) {
Ok(res) => {
println!(
"Wrote '{}'\nRun `cargo crev publish` to upload the file to {}\nThen run `cargo vet import yourname {}`\n",
res.local_path.display(),
res.repo_git_url.as_deref().unwrap_or("your git repo (not configured yet?)"),
res.repo_https_url.as_deref().unwrap_or("https://<your repo URL>/audits.toml"),
);
ExitCode::SUCCESS
}
Err(e) => {
eprintln!("error: {e}");
let mut source = e.source();
while let Some(e) = source {
eprintln!(" {e}");
source = e.source();
}
ExitCode::FAILURE
}
}
}
Loading

0 comments on commit 36a3d61

Please sign in to comment.