# lint-level-warn-to-deny

## AUDIT (2026-01-31)

**Pattern**: Workspace clippy lints set to "warn" instead of "deny"

**Problem**:
- `unwrap_used = "warn"` - New code can introduce unwrap() without CI failure
- `expect_used = "warn"` - New code can introduce expect() without CI failure
- `panic = "warn"` - New code can introduce panic!() without CI failure
- `missing_docs = "warn"` (rust lint) - separate concern, keeping at warn is OK

**Risk**: Drift will happen. The CLAUDE.md says "No Unwrap" but there's no enforcement.

**Current State**:
- `Cargo.toml` lines 21-23 have clippy lints at warn level
- `clippy.toml` correctly allows these in tests (`allow-unwrap-in-tests = true`)
- `Makefile` runs clippy with `-D warnings` which turns warnings into errors
- BUT: developers running `cargo clippy` directly won't see errors

**Fix Strategy**:
1. Change clippy lints from "warn" to "deny" in Cargo.toml
2. This enforces at the workspace level regardless of how clippy is invoked
3. Combined with clippy.toml's test exceptions, tests remain unaffected

## FIX

- [x] Cargo.toml:21-23 - Changed unwrap_used, expect_used, panic from "warn" to "deny"
  - Verified: `cargo clippy --workspace` passes
  - Verified: `cargo test --workspace` passes (test exceptions via clippy.toml work)

## ENFORCE

- [x] CLAUDE.md line 29 - Updated "No Unwrap" rule to mention enforcement mechanism

## DOCUMENT

- [x] .claude/guides/local/quality-checks.md - Added "Enforced Lints" section documenting:
  - Which lints are at deny level
  - Why tests are exempt (clippy.toml)
  - How to add new enforced lints

## COMPLETE (2026-01-31)

**Before:** 4 lints at "warn" level (unwrap_used, expect_used, panic, missing_docs)
**After:** 3 lints at "deny" level, 1 at "warn" (missing_docs - intentional)

**Enforcement added:**
- Workspace Cargo.toml now fails on unwrap/expect/panic outside tests
- CLAUDE.md documents enforcement
- quality-checks.md explains the system

**No drift possible:** Changes are baked into workspace config, not just docs.
