-
Notifications
You must be signed in to change notification settings - Fork 2.1k
chore: Add unused deps lint #10666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add unused deps lint #10666
Conversation
crates/forge/bin/main.rs
Outdated
@@ -1,6 +1,8 @@ | |||
//! The `forge` CLI: build, test, fuzz, debug and deploy Solidity contracts, like Hardhat, Brownie, | |||
//! Ape. | |||
|
|||
#![cfg_attr(not(test), warn(unused_crate_dependencies))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i should've specified to do it only in lib.rs, as main.rs will have unnecessary warnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, re-added to main files. Still seeing the false positives where removing the warned dependencies throws errors as the dependencies are used in test files and the linter specifies not(test). In this case should I add use toml as _;
etc. in the crate root to silence the warnings as make pr
is currenly failing due to the linting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case you need to move them to dev-dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! lgtm
Pending final check by @DaniPopes
Motivation
Closes issue #10665
Solution
Add
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
to ALL cratesPR Checklist
Add
unused_crate_dependencies
lint to all cratesThis adds
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
to alllibrary and binary crates as requested in #10665.