Skip to content

ci: add cargo clippy with deny warnings - #567

Open
Divine-mercyx wants to merge 1 commit into
HubDApp:mainfrom
Divine-mercyx:ci/add-clippy-deny-warnings-511
Open

ci: add cargo clippy with deny warnings#567
Divine-mercyx wants to merge 1 commit into
HubDApp:mainfrom
Divine-mercyx:ci/add-clippy-deny-warnings-511

Conversation

@Divine-mercyx

Copy link
Copy Markdown
Contributor

Summary

  • Make the CI clippy job actually enforce -D warnings by removing the crate-level #![allow(warnings)] in dongle-smartcontract/src/lib.rs.
  • Fix or scope the remaining contract lints (unused imports, needless mut, dead helpers, too_many_arguments) so cargo clippy -p dongle-contract --target wasm32-unknown-unknown -- -D warnings passes.
  • Keep clippy in CI and run it with --all-features so new warnings fail the lint job.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Refactoring / Documentation update

Changes Made

  • Removed crate-wide #![allow(warnings)] from the contract crate.
  • Applied targeted clippy/rustc fixes in the contract sources.
  • Scoped remaining intentional cases with #[allow(clippy::too_many_arguments)] and #[allow(dead_code)].
  • Routed get_project_region / get_project_integrity_hash through ProjectRegistry instead of duplicating storage reads.
  • Strengthened the CI clippy command with --all-features.

Acceptance Criteria

  • CI runs cargo clippy with deny warnings.
  • allow(warnings) in lib.rs is removed rather than left crate-wide.
  • Remaining lints are fixed or scoped to the specific items that need them.

Testing

  • cargo clippy -p dongle-contract --target wasm32-unknown-unknown --all-features -- -D warnings
  • cargo test -p dongle-contract region_and_integrity

Closes #511

Made with Cursor

The crate-level allow(warnings) made the existing clippy job a no-op. Replace it with targeted allows and lint fixes so CI catches new warnings.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

ci: add cargo clippy to CI workflow

1 participant