From c0453ce0932d692c9bb0650aac46c2245ac3eef9 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Fri, 28 Nov 2025 20:15:27 +0100 Subject: [PATCH] fix: Be more explicit about coding quality By making the AGENTS.md file more explicit about the code quality standards, it will hopefully result in cleaner code. There was a tendency to mask unused variables by prefixing them with a _ instead of removing them. That is not what I want: if it's unused, I want it gone. --- AGENTS.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index a24fded..fd2933a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -137,6 +137,7 @@ mod tests { - Keep core business logic separate from external integrations - Use workspace dependencies consistently - When working from a spec, update the spec with the current status as soon as you finish something +- **MANDATORY**: After making ANY code change, complete the Post-Change Verification Checklist (see Code Quality section below) ### 2. Testing - Write tests alongside code in `#[cfg(test)]` modules @@ -149,9 +150,20 @@ mod tests { - Use `cargo fmt` for formatting - Use `cargo clippy` for linting - Ensure documentation for public APIs -- _ALWAYS_ format and lint after making a change, and fix linting errors and warnings +- **MANDATORY: ALWAYS format and lint after making ANY change, and fix ALL linting errors and warnings** - When a change is end-user visible, update the README.md. Use the README.md documentation guidelines -- Always clean up unused code. No todo's or unused code is allowed after a change +- Always clean up unused code. No todo's or unused code is allowed after a change. Remove unused variables, functions, imports, etc. Do NOT hide unused code with underscores - delete it! + +#### Post-Change Verification Checklist (MANDATORY) +After making ANY code change, you MUST run these commands and fix any issues: + +1. **Format code**: `cargo fmt --all` +2. **Run linter**: `cargo clippy --all-targets --all-features -- -D warnings` +3. **Run tests**: `cargo test --workspace` +4. **Build project**: `cargo build --workspace` +5. **Clean up unused code**: Remove any unused variables, functions, imports, etc. + +**FAILURE TO COMPLETE THIS CHECKLIST WILL RESULT IN CODE REJECTION** ### 4. Commit Standards - *Always* ensure the workspace compiles: `cargo build --workspace`