-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclippy.toml
More file actions
75 lines (59 loc) · 2.3 KB
/
Copy pathclippy.toml
File metadata and controls
75 lines (59 loc) · 2.3 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
# Clippy Configuration for Robson v2
# Lint rules specific to this project
# See: https://rust-lang.github.io/rust-clippy/master/index.html
# Cognitive complexity threshold
# (max complexity before clippy warns - lower is stricter)
cognitive-complexity-threshold = 15
# Type complexity threshold
# (max complexity for type definitions)
type-complexity-threshold = 250
# Single char binding names allowed in closures
# (e.g., |x| x + 1 is OK, but let x = ... is not)
single-char-binding-names-threshold = 4
# Too many arguments threshold
# (max function parameters before warning)
too-many-arguments-threshold = 7
# Too many lines threshold
# (max lines in a function before warning)
too-many-lines-threshold = 100
# Vec box size threshold
# (warn if Vec<Box<T>> where sizeof(T) < this)
vec-box-size-threshold = 4096
# Enum variant name threshold
# (max length of enum variant names)
enum-variant-name-threshold = 3
# Literal representation threshold
# (warn on large literals without separators, e.g., 1000000 vs 1_000_000)
literal-representation-threshold = 65536
# Disallowed methods
# (methods that should never be used in this codebase)
disallowed-methods = [
# Financial calculations should use Decimal, not f64
{ path = "f64::from_str", reason = "Use Decimal::from_str_exact instead" },
{ path = "std::primitive::f64::from", reason = "Use Decimal for financial amounts" },
# Avoid panic in production code
{ path = "std::panic::panic", reason = "Return Result instead of panicking" },
]
# Disallowed types
# (types that should not be used in this codebase)
disallowed-types = [
# Financial amounts must use Decimal
{ path = "f32", reason = "Use rust_decimal::Decimal for financial amounts" },
{ path = "f64", reason = "Use rust_decimal::Decimal for financial amounts" },
]
# Avoid breaking exported API
# (warn when public API changes)
avoid-breaking-exported-api = true
# Check private items
# (also lint private functions/types, not just public API)
check-private-items = false
# Allow expect in tests
# (expect/unwrap are OK in test code)
allow-expect-in-tests = true
allow-unwrap-in-tests = true
# Suppress warnings for these specific lints
# (use sparingly - prefer fixing the code instead)
# allowed-lints = []
# Warn on these specific lints
# (upgrade warnings to errors)
# warn-lints = []