Skip to content

Commit 951cc57

Browse files
committed
chore: enforce lint-fix, import style, and doc-alignment in review
Add three style rules to review protocol: - Forbid #[allow(...)] — all warnings must be fixed at source - Require use-imports at file top with grouped common prefixes - Require doc-code alignment on public API changes
1 parent b1b829d commit 951cc57

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

.claude/commands/mm-review.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ Check every change for:
6464
2. **Performance** — does this add latency to hot paths?
6565
3. **API compatibility** — does this change observable behavior?
6666

67-
### Task 4: Unsafe Code Audit
67+
### Task 4: Code Style Enforcement
68+
69+
Check changed files against project style rules:
70+
71+
1. **No lint suppression**`#[allow(clippy::...)]`, `#[allow(unused_...)]`, `#[allow(dead_code)]` etc. are forbidden. All warnings must be fixed at the source, not silenced. Report every `allow(...)` attribute in changed code as a finding.
72+
2. **No inline paths** — Types must be imported via `use` at the top of the file, not referenced inline as `std::collections::HashMap::new()`. The only exception is disambiguation in a single call site where two types share a name.
73+
3. **Import grouping** — Imports with a common prefix must be merged using nested braces: `use std::sync::{Arc, Mutex};` not separate `use std::sync::Arc; use std::sync::Mutex;`.
74+
4. **Doc-code alignment** — If the change modifies a public function signature, struct field, or module-level behavior, verify that the corresponding doc comments, README, and CLAUDE.md still accurately describe the current behavior. Report any stale documentation as a finding.
75+
76+
### Task 5: Unsafe Code Audit
6877

6978
If ANY `unsafe` block is added or modified:
7079
1. Read `.claude/docs/patterns/unsafe-audit.md`

.claude/docs/review-core.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ If the change touches the write path, flush, compaction, or MANIFEST:
8888
- Are new public APIs consistent with existing naming conventions?
8989
- Do new options have sensible defaults?
9090

91+
### 4.4 Code Style Rules
92+
These are enforced project conventions — violations are findings (severity LOW):
93+
- **No lint suppression**: `#[allow(...)]` is forbidden. Warnings must be fixed, not silenced.
94+
- **No inline paths**: Use `use` imports at file top. No `std::foo::Bar::new()` in function bodies (exception: single-site disambiguation of name collisions).
95+
- **Grouped imports**: Common prefixes must be merged — `use std::sync::{Arc, Mutex};` not two separate `use` lines.
96+
- **Doc-code alignment**: Public API changes must have matching doc comment / README / CLAUDE.md updates. Stale docs are a finding.
97+
9198
## Phase 5: Reporting
9299

93100
### Finding Format

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Supporting documentation in `.claude/docs/`:
5050
## Conventions
5151

5252
- All clippy warnings are errors (CI enforced)
53+
- **No `#[allow(...)]`** — fix warnings at the source, never suppress them
54+
- **No inline paths** — use `use` imports at file top; no `std::foo::Bar::new()` in function bodies
55+
- **Grouped imports** — merge common prefixes: `use std::sync::{Arc, Mutex};`
56+
- **Doc-code alignment** — public API changes must update corresponding docs
5357
- `parking_lot` for Mutex/RwLock (non-reentrant, no poisoning)
5458
- `thiserror` for error types
5559
- `tracing` for logging

0 commit comments

Comments
 (0)