Repository navigation
Expand file tree
/
Copy path.clippy.toml
More file actions
40 lines (35 loc) · 2.56 KB
/
Copy path.clippy.toml
File metadata and controls
40 lines (35 loc) · 2.56 KB
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
disallowed-types = [
{ path = "std::collections::HashMap", reason = "Use rustc_hash::FxHashMap for better performance" },
{ path = "std::collections::HashSet", reason = "Use rustc_hash::FxHashSet for better performance" },
]
# Process spawning is allowed at workspace level, then re-denied by the core,
# extract, graph, and engine crates. Core, extract, and graph never spawn
# processes. Engine permits only narrowly expected, engine-owned Git wrappers.
# CLI and MCP legitimately spawn worktrees, sidecars, and subprocesses outside
# the analysis core, so they keep the workspace-level allow.
#
# The same list bans raw `glob::glob` expansion. The config crate denies it
# too, and `expand_disk_glob` in that crate is the one allowed caller. The
# CLI keeps the workspace-level allow, so a CLI call site must use the
# wrapper by review.
disallowed-methods = [
{ path = "std::process::Command::new", reason = "Analysis crates forbid process spawning except narrowly expected engine-owned Git wrappers; the deny is scoped by crate-root attributes" },
{ path = "glob::glob", reason = "glob 0.3 matches `..` against a segment such as `.*`, and an unescaped root breaks on `[`; use fallow_config::glob_validation::expand_disk_glob" },
{ path = "glob::glob_with", reason = "glob 0.3 matches `..` against a segment such as `.*`, and an unescaped root breaks on `[`; use fallow_config::glob_validation::expand_disk_glob" },
{ path = "oxc_ast::ast::Declaration::is_typescript_syntax", reason = "returns true for a TS namespace and enum, which run code on load; match TSTypeAliasDeclaration and TSInterfaceDeclaration instead" },
{ path = "oxc_ast::ast::Statement::is_typescript_syntax", reason = "returns true for a TS namespace and enum, which run code on load; match the type-only statements instead" },
]
# Maximum nesting depth before clippy::excessive_nesting fires.
# Catches deeply nested control flow that should be refactored.
excessive-nesting-threshold = 7
# SIG Unit Size: functions >100 LOC are flagged.
# SIG thresholds: >60 LOC = "very high risk". Ratcheted from 150 to 100
# to keep the worst-offender ceiling tightening over time.
too-many-lines-threshold = 100
# SIG Unit Interfacing: ratcheted from 7 to 6 so the 7-parameter outliers
# get bundled into context structs. SIG 4-star cert wants <=2; 6 is the
# pragmatic project ceiling matching the unit-size ratchet posture.
too-many-arguments-threshold = 6
# SIG Unit Complexity: cognitive complexity >25 = "very high risk".
# This is the clippy default and matches SIG's CC threshold.
cognitive-complexity-threshold = 25