Skip to content

Commit

Permalink
check workspace lints set in check-workspace-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
iliana committed May 8, 2024
1 parent 82fed53 commit 42384f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dev-tools/xtask/src/check_workspace_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 42384f2

Please sign in to comment.