Why this case study matters
clap is the canonical “well-curated Rust library workspace” —
five published members (clap_builder, clap_derive, clap_complete,
clap_mangen, clap_lex) plus the umbrella clap facade and
clap_bench, all sharing one [workspace.package] block for license,
edition, MSRV, repository, and include glob.
The structural surface is small but dense: ~30 distinct checks
across CI workflows, pre-commit hooks, cargo-release config, and the
workspace metadata itself. Roughly 65% maps directly to declarative
alint rules, 5% shells out via command: to typos / cffconvert /
cargo deny, and ~30% is deliberately out of alint’s scope (rustfmt,
clippy, rustdoc, the Cargo-graph checks the Rust toolchain owns).
The fit is higher than rust-lang/rust because clap doesn’t carry its own custom AST-aware linter — the structural surface is exactly the “metadata pinning + manifest hygiene” layer alint targets.
Headline catch
clap’s entire workspace-metadata contract maps to ~12 alint rules.
One Cargo.toml concentrates almost every structural fact about the
workspace:
[workspace.package]license / edition / MSRV / repository / include[workspace.lints.rust]+[workspace.lints.clippy](~70 lints)- Per-member inheritance (
license.workspace = true,edition.workspace = true,rust-version.workspace = true,repository.workspace = true,[lints] workspace = true) - Per-member crates.io discoverability fields (
categories,keywords) - Per-member
[package.metadata.docs.rs]rustdoc-args convention
Each of those 12 invariants becomes one TOML-path rule. Drop in the
five bundled rulesets (oss-baseline, rust, monorepo/cargo-workspace,
ci/github-actions, hygiene/no-tracked-artifacts) for the standard
hygiene layer, and the 24-rule starter config replaces every
structural assertion clap makes about its own workspace.
Where alint earns its keep here
clap is the complementary case study to kubernetes / rust-lang/rust: those are the “huge polyglot monorepo” stories. clap is the “small, disciplined, every-decision-deliberate” story. Together the three span the adoption spectrum.
Use it as the positive baseline for the launch positioning:
“clap is what a clean Rust library workspace looks like, and alint can describe its entire structural-validation surface in 24 lines of YAML. If your Rust workspace is messier than clap’s, alint is probably the cheapest way to surface that delta.”
The pitch is discoverability + onboarding: a contributor runs
alint check once and gets the same structural verdict that 5
separate tools (committed, typos, cffconvert, cargo deny,
pre-commit) plus the bundled rules cover today, in one declarative
file with grep-able rule IDs.
clap also confirms two cross-file rule-kind candidates by demand:
the per-crate metadata identity check (every clap_* member’s
categories[0] resolves to the same value) is now absorbed into
cross_file_value_equals (10 sources, past-saturation, v0.10
ship-target). The pre-release-replacements regex sanity gap is
narrower (cargo-release-specific) and stays on the v0.10 design
candidate list.
Future story angles
- clap as the v0.10 “for_each_dir over
{members}” reference config once the bundledmonorepo/cargo-workspaceselector reads the workspacemembersarray directly — clap’s explicitselect: "{clap_builder,clap_derive,...}"bracket expansion would collapse toselect: "{members}"and survive future crate additions without manual edits. - The “small + disciplined” archetype — clap is the right reference repo for any contributor who wants to model a Rust library workspace’s structural contract end-to-end before scaling up.