forked from cyberfabric/cyberfabric-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclippy.toml
More file actions
59 lines (45 loc) · 2.04 KB
/
clippy.toml
File metadata and controls
59 lines (45 loc) · 2.04 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
# Clippy configuration for HyperSpot
avoid-breaking-exported-api = false
check-inconsistent-struct-field-initializers = true
lint-commented-code = true
#
# Workspace-level lints are configured in Cargo.toml [workspace.lints.clippy]:
#
# The rules below enforce secure ORM usage and help prevent accidental
# bypasses of the secure ORM layer by disallowing direct execution of
# SeaORM queries without scoping.
# Disallow direct execution methods that bypass secure wrappers
disallowed-methods = [
# Select operations - must use SecureSelect
{ path = "sea_orm::Select::all", reason = "Use SecureSelect::all() after .secure().scope_with()" },
{ path = "sea_orm::Select::one", reason = "Use SecureSelect::one() after .secure().scope_with()" },
{ path = "sea_orm::Select::count", reason = "Use SecureSelect::count() after .secure().scope_with()", allow-invalid = true },
# Update operations - must use SecureUpdateMany
{ path = "sea_orm::UpdateMany::exec", reason = "Use SecureUpdateMany::exec() after .secure().scope_with()" },
# Delete operations - must use SecureDeleteMany
{ path = "sea_orm::DeleteMany::exec", reason = "Use SecureDeleteMany::exec() after .secure().scope_with()" },
]
# Note: To enable these checks in a crate, add to the crate root:
# #![deny(clippy::disallowed_methods)]
#
# Or enable warnings instead:
# #![warn(clippy::disallowed_methods)]
# Type complexity threshold (default is 250)
type-complexity-threshold = 190
# Cognitive complexity threshold (default is 25)
cognitive-complexity-threshold = 20
# Function length threshold (default is 100)
too-many-lines-threshold = 200
allow-expect-in-tests = true
allow-unwrap-in-tests = true
# Stricter thresholds for LLM-generated code
single-char-binding-names-threshold = 4
large-error-threshold = 128
# Stack size limits
stack-size-threshold = 512000
# Struct field limits
max-struct-bools = 2
# Disallowed types (prevent common LLM mistakes)
disallowed-types = [
{ path = "std::collections::LinkedList", reason = "Use Vec instead - LinkedList has poor cache locality" },
]