Skip to content

Commit

Permalink
add workspace test crate
Browse files Browse the repository at this point in the history
  • Loading branch information
suaviloquence committed Jun 19, 2024
1 parent 9628e96 commit cb853e6
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/check_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ pub(super) fn run_check_release(
release_type: Option<ReleaseType>,
#[allow(unused_variables)] overrides: OverrideStack,
) -> anyhow::Result<CrateReport> {
config.log_extra_verbose(|cfg| {
writeln!(cfg.stderr(), "overrides: {overrides:?}").map_err(From::from)
})?;
let current_version = current_crate.crate_version();
let baseline_version = baseline_crate.crate_version();

Expand Down
9 changes: 9 additions & 0 deletions test_crates/workspace-overrides/baseline/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]
resolver = "2"
members = ["pkg"]

[workspace.metadata.cargo-semver-checks]
# required-update is not overridden in [package.metadata], but lint-level is
function_missing = { required-update = "minor", lint-level = "warn" }
# lint-level should be overridden in package.metadata
module_missing = "allow"
6 changes: 6 additions & 0 deletions test_crates/workspace-overrides/baseline/pkg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "pkg"
version = "0.1.0"
edition = "2021"

[dependencies]
2 changes: 2 additions & 0 deletions test_crates/workspace-overrides/baseline/pkg/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub fn function_missing() {}
pub mod module_missing {}
9 changes: 9 additions & 0 deletions test_crates/workspace-overrides/current/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]
resolver = "2"
members = ["pkg"]

[workspace.metadata.cargo-semver-checks]
# required-update is not overridden in [package.metadata], but lint-level is
function_missing = { required-update = "minor", lint-level = "warn" }
# lint-level should be overridden in package.metadata
module_missing = "allow"
11 changes: 11 additions & 0 deletions test_crates/workspace-overrides/current/pkg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "pkg"
version = "0.1.0"
edition = "2021"

[dependencies]

[package.metadata.cargo-semver-checks]
# overrides workspace
function_missing = "deny"
module_missing = "warn"
2 changes: 2 additions & 0 deletions test_crates/workspace-overrides/current/pkg/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// pub fn function_missing() {}
// pub mod module_missing {}

0 comments on commit cb853e6

Please sign in to comment.