From f988c1e1ad57a6f0dc0fff227d494011da08cd75 Mon Sep 17 00:00:00 2001 From: Nathaniel McCallum Date: Sat, 31 Oct 2026 10:33:26 -0400 Subject: [PATCH] chore(lint): deny self-named module files In Rust, a module is a named part of a crate (a crate is one Rust library or program). When a module has its own folder, its main code can live in one of two places: in a file inside the folder called `mod.rs` (for example `foo/mod.rs`), or in a file named after the module that sits beside the folder (for example `foo.rs` next to `foo/`). We call the second kind a self-named module file. All crates in the pichi-vm organization use the `mod.rs` style. This change asks Clippy, the standard Rust tool that checks code for common mistakes and style problems, to treat a self-named module file as an error. The shared lint list is the list of code checks Clippy runs and how strict each one is. The top-level `Cargo.toml`, the file for Rust build settings, holds this list for the workspace: the group of crates in this repository that are built together. Each crate's `Cargo.toml` has `[lints] workspace = true`, which means that crate uses the shared lint settings. This workspace has no self-named module files. Fixes #21 --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index cb4ad05..0d7f6da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,8 @@ expect_used = "deny" todo = "deny" unimplemented = "deny" unreachable = "deny" +# Keep a module's code in foo/mod.rs, not in foo.rs beside foo/. +self_named_module_files = "deny" all = { level = "warn", priority = -1 } pedantic = { level = "warn", priority = -1 } module_name_repetitions = "allow"