Skip to content

Commit 36a3d61

Browse files
committed
crev-to-vet converter that converts a proof db into audits.toml
1 parent ade02f2 commit 36a3d61

File tree

6 files changed

+497
-0
lines changed

6 files changed

+497
-0
lines changed

Cargo.lock

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ members = [
66
"crev-data",
77
"crev-wot",
88
"crev-lib",
9+
"crevette",
910
]
1011

1112
[workspace.package]

crevette/Cargo.toml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "crevette"
3+
description = "Converter for using cargo-crev reviews with cargo-vet"
4+
keywords = ["cargo-vet", "crev2vet", "cargo-crev", "exporter", "supply-chain-security"]
5+
categories = ["development-tools"]
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
rust-version.workspace = true
11+
version.workspace = true
12+
13+
[dependencies]
14+
crev-lib.workspace = true
15+
crev-data.workspace = true
16+
crev-wot.workspace = true
17+
semver.workspace = true
18+
serde.workspace = true
19+
toml_edit = { version = "0.19.14", features = ["serde"] }

crevette/src/bin/crevette.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crevette::Crevette;
2+
use std::error::Error as _;
3+
use std::process::ExitCode;
4+
5+
fn main() -> ExitCode {
6+
match Crevette::new().and_then(|c| c.convert_into_repo()) {
7+
Ok(res) => {
8+
println!(
9+
"Wrote '{}'\nRun `cargo crev publish` to upload the file to {}\nThen run `cargo vet import yourname {}`\n",
10+
res.local_path.display(),
11+
res.repo_git_url.as_deref().unwrap_or("your git repo (not configured yet?)"),
12+
res.repo_https_url.as_deref().unwrap_or("https://<your repo URL>/audits.toml"),
13+
);
14+
ExitCode::SUCCESS
15+
}
16+
Err(e) => {
17+
eprintln!("error: {e}");
18+
let mut source = e.source();
19+
while let Some(e) = source {
20+
eprintln!(" {e}");
21+
source = e.source();
22+
}
23+
ExitCode::FAILURE
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)