-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclippy.toml
More file actions
102 lines (90 loc) · 2.32 KB
/
clippy.toml
File metadata and controls
102 lines (90 loc) · 2.32 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
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
94
95
96
97
98
99
100
101
102
# Clippy Configuration - Strict Settings
# https://doc.rust-lang.org/clippy/configuration.html
# Minimum Supported Rust Version
msrv = "1.75.0"
# Complexity thresholds
cognitive-complexity-threshold = 25
excessive-nesting-threshold = 4
too-many-arguments-threshold = 7
too-many-lines-threshold = 100
type-complexity-threshold = 250
# Naming thresholds
enum-variant-name-threshold = 3
min-ident-chars-threshold = 1
# Size thresholds
pass-by-value-size-limit = 256
trivial-copy-size-limit = 8
future-size-threshold = 16384
large-error-threshold = 128
array-size-threshold = 512000
vec-box-size-threshold = 4096
literal-representation-threshold = 4
# Documentation valid identifiers
doc-valid-idents = [
"GitHub",
"GitLab",
"JavaScript",
"TypeScript",
"OpenAI",
"OAuth",
"OAuth2",
"API",
"APIs",
"HTTP",
"HTTPS",
"URL",
"URLs",
"URI",
"URIs",
"JSON",
"XML",
"HTML",
"CSS",
"SSE",
"WebSocket",
"WebSockets",
"UUID",
"UUIDs",
"ULID",
"ULIDs",
"LSP",
"MCP",
"PTY",
"TTY",
"CLI",
"TUI",
"SDK",
"Anthropic",
"Claude",
"macOS",
"iOS",
"NixOS",
"rustdoc",
"rustfmt",
"Clippy",
]
# Allowed identifiers below min chars
allowed-idents-below-min-chars = ["i", "j", "k", "n", "x", "y", "z", "id", "tx", "rx", "db"]
# Disallowed methods
disallowed-methods = [
{ path = "std::env::var", reason = "Use std::env::var_os and handle OsString properly" },
]
# Disallowed macros (no println in library code)
disallowed-macros = [
{ path = "std::println", reason = "Use tracing macros (info!, debug!, etc.) instead" },
{ path = "std::print", reason = "Use tracing macros (info!, debug!, etc.) instead" },
{ path = "std::eprintln", reason = "Use tracing macros (error!, warn!, etc.) instead" },
{ path = "std::eprint", reason = "Use tracing macros (error!, warn!, etc.) instead" },
{ path = "std::dbg", reason = "Remove debug macros before committing" },
]
# Semicolon settings
semicolon-inside-block-ignore-singleline = true
semicolon-outside-block-ignore-multiline = true
# API compatibility
avoid-breaking-exported-api = true
# Test-specific settings
allow-dbg-in-tests = true
allow-expect-in-tests = true
allow-unwrap-in-tests = true
# Enforce iter loop reborrow
enforce-iter-loop-reborrow = true