Skip to content

[Infra] Add cargo fmt --check and clippy gates to contracts CI #460

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

The contracts CI job (.github/workflows/ci.yml) builds the WASM and runs cargo test, but there is no formatting or lint gate for the Rust code — no cargo fmt --check and no cargo clippy. The repo has no rustfmt.toml. This means style drift and common Rust foot-guns (needless clones, unwraps, etc.) land unflagged, and contributors get no fast local signal. Adding these two checks is cheap and catches a whole class of review nits automatically.

Acceptance criteria

  • Add a cargo fmt --all -- --check step to the contracts job in .github/workflows/ci.yml (fails the build on unformatted code).
  • Add a cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings step (or a sensible warning gate appropriate for #![no_std] Soroban code).
  • Ensure the existing contracts/ source passes both checks (apply cargo fmt and fix or #[allow] justified clippy findings).
  • Add rustfmt and clippy components to the toolchain setup step.

Files to touch

  • .github/workflows/ci.yml
  • contracts/ (formatting fixes as needed)

Out of scope

  • JS/TS lint changes (frontend already runs npm run lint).

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdevopsInfrastructure and CI/CDgood first issueGood for newcomersinfraCI/CD and infrastructure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions