Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,17 @@ unnecessary_safety_comment = "deny" # Accurate safety comments
# ───── DENY level lints — safety, correctness, discipline ─────
# These MUST be clean in production code. clippy.toml relaxes test code
# automatically via allow-*-in-tests settings.
missing_errors_doc = "deny" # Document error conditions
missing_panics_doc = "deny" # Document panic conditions
missing_safety_doc = "deny" # Document safety requirements
cognitive_complexity = "deny" # Keep functions simple (default threshold=25; violations get scoped #[expect])
too_many_lines = "deny" # Keep functions short (default threshold=100; violations get scoped #[expect])
type_complexity = "deny" # Keep types simple (default threshold=250; violations get scoped #[expect])
missing_errors_doc = "deny" # Document error conditions
missing_panics_doc = "deny" # Document panic conditions
missing_safety_doc = "deny" # Document safety requirements
cognitive_complexity = "deny" # Keep functions simple (default threshold=25; violations get scoped #[expect])
too_many_lines = "deny" # Keep functions short (default threshold=100; violations get scoped #[expect])
type_complexity = "deny" # Keep types simple (default threshold=250; violations get scoped #[expect]) — see trait_policy.md §2
# ── Phase 7f trait/generic/dispatch discipline lints — see trait_policy.md §2 ──
too_many_arguments = "deny" # Keep fn signatures lean (default threshold=7; violations get scoped #[expect]) — see trait_policy.md §2
trait_duplication_in_bounds = "deny" # Disallow `T: Foo + Foo + Bar` duplicate bounds — see trait_policy.md §8 anti-patterns
wrong_self_convention = "deny" # Enforce as_*/into_*/to_*/from_* method-name conventions — see trait_policy.md §2
multiple_bound_locations = "warn" # Discourage split `<T: …>` + `where T: …` on the same `T` — see trait_policy.md §2
large_enum_variant = "deny" # Optimize enum memory usage
large_stack_arrays = "deny" # Avoid large stack allocations
large_types_passed_by_value = "deny" # Pass large types by reference
Expand Down
10 changes: 10 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
# five-category taxonomy (α-ε) and the per-site justification contract.
# Audit script: `scripts/dev/clone_alloc_audit.sh`.
#
# The trait / generic / dispatch lints (`type_complexity`,
# `too_many_arguments`, `trait_duplication_in_bounds`,
# `wrong_self_convention`, `multiple_bound_locations`) likewise stay at
# `deny` / `warn` for prod code; see
# `docs/architecture/code-quality/trait_policy.md` for the four-criterion
# trait justification taxonomy (J1-J4), the generic-function categories
# (G1-LOCAL / G2-USEFUL / G3-SPREAD / G4-CASCADING / G5-CLOSURE), the
# dispatch matrix (D1-D4 + S1-S3), and the seal/open decision tree.
# Audit script: `scripts/dev/trait_generic_audit.sh`.
#
# For the broader lint posture see
# `docs/architecture/code-quality/lint-posture.md`.
allow-unwrap-in-tests = true
Expand Down
Loading