From cd5a1c8bd37355cdc472f93d97bfb17d5bdb8c8b Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 4 Oct 2022 10:17:00 -1000 Subject: [PATCH 1/3] Switch CI test run to --all-targets. Currently we're not running integration tests in CI, so things like test_cli are currently failing. This new flag appears (confusingly) to run all tests except doc tests, whereas bare cargo test also runs doc tests. Given that we have a separate job for doc tests already, this seems to be what we want. --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 44083760..7ef73c9e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v2 - name: Run cargo test run: | - cargo test --workspace --examples --bins + cargo test --workspace --all-targets vet: runs-on: ubuntu-latest From 9fb1f00cae262d07e4fc8acef58db1a10fc333b8 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 4 Oct 2022 10:19:19 -1000 Subject: [PATCH 2/3] Update snapshots for cargo vet aggregate. --- tests/snapshots/test_cli__long-help.snap | 2 ++ tests/snapshots/test_cli__markdown-help.snap | 24 ++++++++++++++++++++ tests/snapshots/test_cli__short-help.snap | 2 ++ 3 files changed, 28 insertions(+) diff --git a/tests/snapshots/test_cli__long-help.snap b/tests/snapshots/test_cli__long-help.snap index ba5d45a7..ac55a50d 100644 --- a/tests/snapshots/test_cli__long-help.snap +++ b/tests/snapshots/test_cli__long-help.snap @@ -149,6 +149,8 @@ SUBCOMMANDS: Reformat all of vet's files (in case you hand-edited them) fetch-imports Explicitly fetch the imports (foreign audit files) + aggregate + Fetch and merge audits from multiple sources into a single `audits.toml` file dump-graph Print the cargo build graph as understood by `cargo vet` gc diff --git a/tests/snapshots/test_cli__markdown-help.snap b/tests/snapshots/test_cli__markdown-help.snap index 45b9d7a0..40a3a517 100644 --- a/tests/snapshots/test_cli__markdown-help.snap +++ b/tests/snapshots/test_cli__markdown-help.snap @@ -147,6 +147,7 @@ graph * [record-violation](#cargo-vet-record-violation): Declare that some versions of a package violate certain audit criteria * [fmt](#cargo-vet-fmt): Reformat all of vet's files (in case you hand-edited them) * [fetch-imports](#cargo-vet-fetch-imports): Explicitly fetch the imports (foreign audit files) +* [aggregate](#cargo-vet-aggregate): Fetch and merge audits from multiple sources into a single `audits.toml` file * [dump-graph](#cargo-vet-dump-graph): Print the cargo build graph as understood by `cargo vet` * [gc](#cargo-vet-gc): Clean up old packages from the vet cache * [help](#cargo-vet-help): Print this message or the help of the given subcommand(s) @@ -654,6 +655,29 @@ Print help information ### GLOBAL OPTIONS This subcommand accepts all the [global options](#global-options) +


+## cargo vet aggregate +Fetch and merge audits from multiple sources into a single `audits.toml` file. + +Will fetch the audits from each URL in the provided file, combining them into a single file. Custom +criteria will be merged by-name, and must have identical descriptions in each source audit file. + +### USAGE +``` +cargo vet aggregate [OPTIONS] +``` + +### ARGS +#### `` +Path to a file containing a list of URLs to aggregate the audits from + +### OPTIONS +#### `-h, --help` +Print help information + +### GLOBAL OPTIONS +This subcommand accepts all the [global options](#global-options) +


## cargo vet dump-graph Print the cargo build graph as understood by `cargo vet` diff --git a/tests/snapshots/test_cli__short-help.snap b/tests/snapshots/test_cli__short-help.snap index 80e28819..de03094c 100644 --- a/tests/snapshots/test_cli__short-help.snap +++ b/tests/snapshots/test_cli__short-help.snap @@ -70,6 +70,8 @@ SUBCOMMANDS: record-violation Declare that some versions of a package violate certain audit criteria fmt Reformat all of vet's files (in case you hand-edited them) fetch-imports Explicitly fetch the imports (foreign audit files) + aggregate Fetch and merge audits from multiple sources into a single `audits.toml` + file dump-graph Print the cargo build graph as understood by `cargo vet` gc Clean up old packages from the vet cache help Print this message or the help of the given subcommand(s) From a2b9ffbd04b6d3e92b7c9a2d29dfcfa897a8fdff Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 4 Oct 2022 10:21:58 -1000 Subject: [PATCH 3/3] Fix clippy warning from new Rust release. --- src/storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.rs b/src/storage.rs index c7e93993..20fe8c1a 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -509,7 +509,7 @@ impl Store { // validate that our imports.lock is in sync with config.toml. let imports_lock_outdated = self .imports_lock_outdated() - .then(|| StoreValidateError::ImportsLockOutdated); + .then_some(StoreValidateError::ImportsLockOutdated); let errors = invalid_criteria_errors .into_iter()