Skip to content

Apply the Rust 2024 formatting style and check it in CI #5

Done

Description

@francescobianco

Description

The crate is on edition 2024, but the code still follows the old formatting style. Running cargo fmt --check today reports differences in 43 files. Most of them come from the 2024 style edition's new sort order for imports, for example:

-use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_TYPE};
+use reqwest::header::{AUTHORIZATION, CONTENT_TYPE, HeaderMap, HeaderValue};

Proposal

  • Run cargo fmt once and commit the result as a single, formatting-only commit, so the diff is easy to review.
  • Add a cargo fmt --all -- --check step to .github/workflows/rust.yml so formatting can't drift again.

Benefits

  • ✅ Code consistent with the 2024 style edition
  • ✅ Smaller diffs in future PRs, with no formatting noise
  • ✅ Contributors get immediate CI feedback

Acceptance criteria

  • cargo fmt --all -- --check passes locally
  • CI runs the format check on push and PR
  • No functional changes in the PR

Context

This is part of bringing openapi-cli up to the same baseline the Openapi® Rust SDK just reached with its move to the Rust 2024 edition (openapi-rust-sdk#14, announced in discussions#86). The CLI already uses edition = "2024"; these issues make it hold up in practice.

New here?

This is a small, self-contained task: a great first contribution to an Openapi® project. Comment below to claim it, then fork, branch and open a PR referencing this issue. Questions are welcome in the thread. Once merged, you are welcome to add yourself to the official Openapi® contributors registry. 🦀

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on Nov 23, 2026
  2. mountaincoding commented on Nov 30, 2026

    @mountaincoding
    Contributor

    I'd love to help with the formatting and CI changes. Would you mind adding me as the assignee for this issue? Thank you!

  3. mountaincoding commented on Dec 1, 2026

    @mountaincoding
    Contributor

    Heads up - my initial PR (#9) was automatically closed after I accidentally deleted my fork before merging so I submitted a new one (#11). The original changes and testing results remain unchanged. Apologies!

  4. francescobianco commented on Dec 4, 2026

    @francescobianco
    MemberAuthor

    Thanks a lot @mountaincoding! 🙌

    No need to apologize about #9: deleted forks happen, and re-opening it as #11 with the same changes and test results was exactly the right move. It's now merged, with the formatting commit and the CI commit kept separate as the issue asked, so cargo fmt --check now runs on every push and PR.

    Since you've now landed two contributions to openapi-cli (this one and #4 via #12), we'd be glad to have you as an official Openapi® contributor. I saw that openapi/contributors#7 was closed when your fork went away: feel free to open it again, and you can set openapi/openapi-cli as your main project. I'll merge it as soon as it comes in. 🦀

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

Metadata

Metadata

Labels

enhancementgood first issuehelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions