Skip to content

Enforce rustfmt, pedantic clippy and rustdoc in CI - #15

Open
LucaCappelletti94 wants to merge 1 commit into
openapi:mainfrom
LucaCappelletti94:ci/lint-gates
Open

LucaCappelletti94 wants to merge 1 commit into
openapi:mainfrom
LucaCappelletti94:ci/lint-gates

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

At this time, CI only builds and tests.

This PR adds:

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo doc with warnings denied
  • [lints] table enabling clippy::pedantic and missing_docs and others.
  • Fixes most findings, mostly missing # Errors and # Panics doc sections. The one #[expect] needs Rust 1.81, which Refresh Cargo.lock within a declared 1.85 MSRV #14 declares.

Client::new now takes &str instead of String, since it never consumed the token. That breaks callers, so the next release should be 0.2, and we will actually enforce this when in a later PR I will add the semver job.

@francescobianco francescobianco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thank you! See my comment below for the merge order.

@francescobianco

Copy link
Copy Markdown
Member

@LucaCappelletti94 thank you, this is a big step up for the crate! 🙏 fmt, pedantic clippy and rustdoc with warnings denied, plus the # Errors / # Panics sections: approved.

Now that #14 is merged, this one needs a quick rebase on main. I tried the combination locally:

  1. Cargo.toml conflict: keep both sides, your [lints.rust] / [lints.clippy] tables and Refresh Cargo.lock within a declared 1.85 MSRV #14's [dev-dependencies] tokio with rt-multi-thread (without it the examples fail to compile).
  2. cargo fmt --check fails after the rebase: edition 2024 sorts imports differently (use http::HeaderMap; now goes before use http::header::{…}), so a cargo fmt --all on top of the rebase fixes it.

With those two, cargo clippy --all-targets --locked -- -D warnings, cargo test and RUSTDOCFLAGS="-D warnings" cargo doc --no-deps all pass for me. Push the rebase and I'll approve the CI run and merge.

Since Client::new(&str) is breaking, feel free to bump Cargo.toml to 0.2.0 here, so that #16 is green from day one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants