Skip to content

Fix clippy warnings and run clippy in CI with -D warnings #6

Open

Description

@francescobianco

Description

cargo clippy --all-targets currently reports 2 collapsible_if warnings, both in src/commands/info.rs:

warning: this `if` statement can be collapsed
  --> src/commands/info.rs:71:5   (if oauth_ready { if has_token { ... } })
  --> src/commands/info.rs:89:5   (if oauth_sandbox_ready { if has_sandbox_token { ... } })

CI never runs clippy, so warnings like these pile up unnoticed.

Proposal

  • Collapse the two nested ifs (if oauth_ready && has_token { ... }) and make sure the behavior stays the same.
  • Add a clippy step to .github/workflows/rust.yml:
- name: Clippy
  run: cargo clippy --all-targets -- -D warnings

Benefits

  • ✅ Clean lint baseline
  • ✅ Any new warning fails CI instead of accumulating
  • ✅ Clippy's edition-aware suggestions keep the code idiomatic for Rust 2024

Acceptance criteria

  • cargo clippy --all-targets -- -D warnings passes
  • CI runs clippy on push and PR
  • openapi info output is unchanged

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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