Skip to content

Ban wildcard imports via clippy::wildcard_imports - #4098

Open
ayushsingh82 wants to merge 1 commit into
near:mainfrom
ayushsingh82:ban-wildcard-imports
Open

Ban wildcard imports via clippy::wildcard_imports#4098
ayushsingh82 wants to merge 1 commit into
near:mainfrom
ayushsingh82:ban-wildcard-imports

Conversation

@ayushsingh82

Copy link
Copy Markdown

Summary

  • Denies clippy::wildcard_imports at the workspace level ([workspace.lints.clippy] in Cargo.toml)
  • Replaces the 10 pre-existing non-test wildcard imports with explicit imports, using clippy's own suggested import lists
  • clippy::wildcard_imports already exempts use super::* inside modules literally named tests, which matches the exception described in the issue

Closes #2629

Verification

  • cargo clippy --workspace --all-features --all-targets -- -D warnings: 0 wildcard-import violations (the only remaining failure locally is an unrelated tikv-jemalloc-sys native build error caused by a space in the local clone path — not present in CI)
  • cargo test on the three touched crates (near-mpc-bounded-collections, mpc-contract, mpc-devnet): 484 tests passing, 0 failed (2 pre-existing mpc-contract ABI test failures are unrelated — reproduced identically on main, caused by a local cargo-near CLI version mismatch)
  • cargo fmt -- --check: clean

Test plan

  • CI clippy job passes with the new wildcard_imports = "deny" lint
  • CI test suite passes

Denies clippy::wildcard_imports at the workspace level and replaces the
10 existing non-test wildcard imports with explicit imports. The lint
already exempts `use super::*` inside modules named `tests`, matching
the exception called out in near#2629.

Closes near#2629
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.

Ban wildcard imports

1 participant