Conversation
gilcu3
left a comment
There was a problem hiding this comment.
Very hard to not approve (given that the compiler says it is fine)
DSharifi
left a comment
There was a problem hiding this comment.
Thank you!
Could you please enforce this clippy lint as part of the PR? clippy::mod_module_files
Done in 7764233 |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase to eliminate mod.rs files by adding the #![deny(clippy::mod_module_files)] lint to enforce using module file names instead of mod.rs files.
- Adds clippy lint to prevent
mod.rsusage across all library entry points - Enforces consistent module organization using individual module files
Reviewed Changes
Copilot reviewed 7 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| node/src/lib.rs | Adds clippy lint to deny mod.rs files |
| libs/chain-signatures/contract/src/lib.rs | Adds clippy lint to deny mod.rs files |
| crates/tls/src/lib.rs | Adds clippy lint to deny mod.rs files |
| crates/test_utils/src/lib.rs | Adds clippy lint to deny mod.rs files |
| crates/tee_authority/src/lib.rs | Adds clippy lint to deny mod.rs files |
| crates/primitives/src/lib.rs | Adds clippy lint to deny mod.rs files |
| crates/attestation/src/lib.rs | Adds clippy lint to deny mod.rs files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
DSharifi
left a comment
There was a problem hiding this comment.
Thanks.
Just a tip, we alternatively add the the lint to the workspaceCargo.toml file instead of in the source code
[workspace.lints.clippy]
mod_module_files = "forbid"And inheritance to the workspace members's Cargo.toml files:
[lints]
workspace = trueIt's unfortunate that the explicit workspace inheritance is needed for the lints though. There's a tracking issue for automatically inheriting the lints:
rust-lang/cargo#12208
7764233 to
308c39f
Compare
Right, nice. Updated this in 308c39f |
308c39f to
9748f1a
Compare
This caused some clippy errors in the Devnet crate. Probably worth fixing it, but in the interest of not getting stuck on this I reverted and restored the old top level attributes to enforce the lint. |
9748f1a to
a02b15e
Compare
Makes sense. Thanks for trying :) Created #1005 so we can revisit in the future. |
closes #996
Note: This is a matter of personal preference. If anyone has conflicting opinions of this, don't hesitate to speak up.