Skip to content

ci: enforce Clippy warnings for the contract library - #273

Merged
Jagadeeshftw merged 1 commit into
AnchorNet-Org:mainfrom
mikewheeleer:codex/issue-261-clippy
Aug 30, 2026
Merged

ci: enforce Clippy warnings for the contract library#273
Jagadeeshftw merged 1 commit into
AnchorNet-Org:mainfrom
mikewheeleer:codex/issue-261-clippy

Conversation

@mikewheeleer

Copy link
Copy Markdown
Contributor

Summary

  • add a strict cargo clippy --lib -- -D warnings gate to the shared Makefile and CI workflow
  • remove type-preserving pagination casts and restore the typed storage accessors that were preventing the library from compiling
  • preserve the established Soroban event wire format with a narrowly scoped deprecation allowance
  • document the pre-fix inventory, scope decision, allow policy, and wasm verification in docs/CLIPPY-AUDIT.md

Audit result

The pinned stable toolchain reported 38 production findings before fixes: 27 deprecated Events::publish calls, 10 unnecessary u32 casts, and one unused typed storage probe. The 10 casts were removed. The event migration is deferred because switching to #[contractevent] can change the compatibility-sensitive serialized event shape. The two intentionally retained dead-code probes have narrow, documented allowances; no crate-level blanket allowance was added.

Test-target linting is explicitly deferred: the checked-in event regression block does not compile against Soroban SDK 25.3 (Address::random and ContractEvents::len/get are unavailable), so cargo test and cargo clippy --all-targets cannot reach a test lint inventory. This PR does not suppress those failures or change test behavior.

Verification

  • cargo fmt --all -- --check
  • make clippy
  • cargo build
  • cargo build --target wasm32-unknown-unknown --release (92 KiB artifact)
  • cargo test --lib --no-run remains blocked by the pre-existing test/API incompatibility described above

The release wasm artifact builds successfully; a before/after byte delta is not available because the upstream baseline source does not compile before this prerequisite repair.

Closes #261

@Jagadeeshftw
Jagadeeshftw merged commit eb6a33a into AnchorNet-Org:main Aug 30, 2026
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.

No clippy in CI — add it with -D warnings and clear the resulting lints across the contract

2 participants