1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2025 Umberto Gotti <umberto.gotti@umbertogotti.dev>
// Licensed under the MIT License
// SPDX-License-Identifier: MIT
use Path;
use PathBuf;
use WalkDir;
// Every .rs file under a package, tests included.
//
// "Every .rs file" is the rule's own wording, so src/ and tests/ are both in
// scope -- a test file without the header is exactly as wrong as a source file
// without it. target/ is skipped because it holds generated code nobody wrote
// and build scripts write files there that no rule should judge.
//
// Nothing else is skipped. An earlier version also skipped any directory
// holding its own Cargo.toml, so that a fixture crate nested under
// tests/fixtures/ would not be judged as though this package had written it.
// That was the wrong place to solve it: sample code a tool analyses does not
// belong inside the package that ships, and a linter quietly declining to look
// at part of a tree is the kind of silence this tool exists to refuse. The fix
// belongs in the layout -- fixtures live beside the package, not within it --
// and where a tree genuinely cannot be moved, in an explicit exclusion the
// reader can see in the report.
;