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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# clippy.toml — ix project lint policy
#
# ALIGNMENT: AGENTS.md conventions + lib.rs global allow set + CI gate (-D warnings)
# MSRV 1.85 anchors the lint baseline. Enterprise-grade policy:
# - No unwrap/expect/panic outside tests
# - No anyhow in library code
# - Pedantic with pragmatic scoped allows only
# - All public API documented (missing_docs)
# ── Rust toolchain baseline ──────────────────────────────────────────
= "1.85"
# ── Test exceptions ──────────────────────────────────────────────────
# Tests are allowed to use convenience patterns that are banned in
# production code. The project's lib.rs already has #[cfg_attr(test, allow(missing_docs))].
= true
= true
= true
# ── Complexity gates ─────────────────────────────────────────────────
# Cognitive complexity: functions above this threshold signal refactoring
# candidates. Matches the project's "clean architecture" ethos without
# being draconian — executor and scanner are long but well-structured.
= 30
# Too many arguments: more than this signals a configuration struct
# should be used instead of loose parameters.
= 8
# Type complexity: nested generics beyond this point suggest a type alias.
= 400
# ── Banned methods (production code) ─────────────────────────────────
# unwrap/expect/panic are banned in library. Tests exempt via flags above.
# These fire as warnings (pedantic gate).
# Note: not using disallowed-methods here — we want the standard
# clippy::unwrap_used / clippy::expect_used lints which respect
# allow-unwrap-in-tests. disallowed-methods does not.
# ── Banned types ─────────────────────────────────────────────────────
# anyhow is banned in library code — use thiserror (AGENTS.md).
= [
{ = "anyhow::Error", = "use thiserror::Error in library code (AGENTS.md convention)" },
]
# ── Documentation identifiers ────────────────────────────────────────
= [
"GitHub", "README", "CHANGELOG", "API",
"O(n)", "O(n^2)", "O(log n)", "XXH64", "CRC32C",
"NDJSON", "TOCTOU", "LRU", "FIFO", "RSS",
"ZSTD", "Gzip", "Bzip2", "XZ",
"BFS", "CDX", "SGL",
"Unix", "Linux", "macOS", "Windows",
"stdin", "stdout", "stderr",
"Mmap", "mmap", "MADV_WILLNEED",
"RwLock", "Mutex", "Arc", "Send", "Sync",
"CPU", "RAM", "IO", "OOM",
]
# ── Enum / type size limits ──────────────────────────────────────────
# Error enums should remain compact — large variants bloat the Result
# type across every call site.
= 256
# Prevent large types from being stack-allocated in deep recursion.
= 2048
# ── Boolean parameter gates ──────────────────────────────────────────
# Structs with many boolean fields should use a builder or bitflags.
# Matches the #[allow(clippy::struct_excessive_bools)] pattern —
# 3 is the default, bumped to 5 because CLI config structs naturally
# carry many toggles.
= 5
= 4
# ── Correctness enforcement ──────────────────────────────────────────
# Enforce iterator loop reborrowing for correctness.
= true
# ── Copy / pass-by-value tuning ──────────────────────────────────────
# When a type is trivial to copy, prefer passing by value.
= 128
# Larger types should not be passed by value.
= 512
# ── Path / naming hygiene ────────────────────────────────────────────
# Disallow deeply nested paths — signals module structure issues.
= 6
# Methods named `new` should return Self.
# Methods named `from_*` should be conversion constructors.
# (These are default clippy checks — noted here for explicitness.)