CI/lints: forbid(unsafe_code), missing_docs, cargo-deny, cargo-semver-checks - #125
Merged
Conversation
Guarantee the crate stays unsafe-free and require docs on public items. Exempt the code-generated `generated` module (adds `missing_docs` to its existing `#[allow(...)]`) since its Options builder methods carry no doc comments and it must not be hand-edited; hand-written code is fully documented and builds warning-clean for missing_docs. Part of #116
Add deny.toml (advisories + licenses + bans + sources) and a cargo-deny workflow running on push/PR and weekly. The crate's job is making network calls, so a vulnerable transitive dependency is a real risk; nothing checked the RustSec advisory DB before. License allow-list covers every license currently in the tree. Part of #116
Diff each PR's public API against the PR base commit (baseline-rev, since the crate ships via git and has no crates.io baseline) and fail if the change exceeds what the Cargo.toml version bump allows. The crate went 0.3.3 -> 0.12.0 with no mechanical SemVer check. Part of #116
The crate isn't published to crates.io (ships via git), so the default registry baseline fails with 'datamaxi not found in registry'. Use baseline-rev against the PR base commit with fetch-depth: 0 so the baseline is available. Part of #116
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #116 — the Lints / CI hygiene section. Ticks these boxes:
#![forbid(unsafe_code)]#![warn(missing_docs)]cargo-deny(orcargo-audit) to CIcargo-semver-checksto CINot in this PR: the API/runtime, naming, and other #116 items.
What changed
src/lib.rs#![forbid(unsafe_code)]— the crate has nounsafe; make it a guarantee. Build passes.#![warn(missing_docs)]at the crate root. The hand-written code (src/api.rs,src/lib.rs) already fully satisfies it — zero new warnings.missing_docsto the existing#[allow(...)]onpub mod generated.src/generated.rsis produced by the externaldatamaxi-codegentool (DO NOT EDIT) and itsOptionsbuilder methods carry no doc comments, so a crate-widemissing_docswould flood warnings from generated code. Exempting only that module keeps generated code from blocking CI while holding hand-written code to the standard. Tracked for a real fix (emit docs in codegen) in codegen: emit doc comments on generated Options builders #124, after which the exemption can be removed.deny.toml+.github/workflows/deny.yml—cargo deny check advisories bans licenses sourceson push/PR and weekly. The crate's whole job is network calls and nothing checked the RustSec advisory DB. License allow-list covers every license currently in the dependency tree..github/workflows/semver.yml—cargo-semver-checkson PRs. The crate isn't published to crates.io (it ships via git), so there's no registry baseline; the job diffs each PR's public API against the PR base commit (baseline-rev,fetch-depth: 0). The crate went 0.3.3 → 0.12.0 with no mechanical SemVer check.Test plan
Ran locally (Rust stable,
--all-features):cargo fmt --all -- --check— cleancargo clippy --all-targets --all-features -- -D warnings— cleancargo test— 34 unit + 5 doc-tests passcargo build/cargo build --all-features— nomissing_docswarnings;forbid(unsafe_code)compilescargo doc --no-deps— no new warnings (pre-existing broken-intra-doc-link warnings inapi.rsare unrelated to this PR and present onmain)cargo-deny/cargo-semver-checksaren't installed locally, so those YAMLs are validated by inspection: action inputs checked against each action'saction.yml(EmbarkStudios/cargo-deny-action@v2command;obi1kenobi/cargo-semver-checks-action@v2baseline-rev/feature-group),deny.tomlvalidated as TOML and written to the cargo-deny 0.16+ schema, and the license allow-list derived fromcargo metadataover the actual tree. They will first execute in CI on this PR.Known failures / caveats
semver-checksrun compares against the base commit, which equalsmain; this PR makes no public API change, so it should pass.