diff --git a/dev-tools/xtask/src/check_workspace_deps.rs b/dev-tools/xtask/src/check_workspace_deps.rs index 6e84380c69..76e405ce1a 100644 --- a/dev-tools/xtask/src/check_workspace_deps.rs +++ b/dev-tools/xtask/src/check_workspace_deps.rs @@ -31,14 +31,24 @@ pub fn run_cmd() -> Result<()> { // Iterate the workspace packages and fill out the maps above. for pkg_info in workspace.workspace_packages() { + let manifest_path = &pkg_info.manifest_path; + let manifest = read_cargo_toml(manifest_path)?; + + // Check that `[lints] workspace = true` is set. + if !manifest.lints.map(|lints| lints.workspace).unwrap_or(false) { + eprintln!( + "error: package {:?} does not have `[lints] workspace = true` set", + pkg_info.name + ); + nerrors += 1; + } + if pkg_info.name == WORKSPACE_HACK_PACKAGE_NAME { // Skip over workspace-hack because hakari doesn't yet support // workspace deps: https://github.com/guppy-rs/guppy/issues/7 continue; } - let manifest_path = &pkg_info.manifest_path; - let manifest = read_cargo_toml(manifest_path)?; for tree in [ &manifest.dependencies, &manifest.dev_dependencies, diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index 4222d6141a..d15a2242be 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -9,6 +9,9 @@ description = "workspace-hack package, managed by hakari" # You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing. publish = false +[lints] +workspace = true + # The parts of the file between the BEGIN HAKARI SECTION and END HAKARI SECTION comments # are managed by hakari.