Repository navigation
build(lint): enforce the AGENTS.md size and complexity rules - #7
Merged
Merged
Conversation
Cap arguments, nesting, and cognitive complexity through clippy, require reasons on allow attributes, and reject staged Rust files longer than 500 lines in pre-commit. Refs furedea/dotfiles#213 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
clippy.toml(new):too-many-arguments-threshold = 3,excessive-nesting-threshold = 2,cognitive-complexity-threshold = 15.Cargo.toml[lints.clippy]: warn onallow_attributes_without_reason(restriction),cognitive_complexity(nursery), andexcessive_nesting(restriction).too_many_argumentsis already on throughclippy::all.lefthook.yml: newfile-lengthpre-commit command that rejects staged*.rsfiles over 500 lines.Tool versions checked
clippy.tomlkeys are accepted (clippy rejects unknown keys) and all lint names exist. A probe crate with four arguments, three nestedifs, and a reason-less#[allow]triggeredtoo_many_arguments(4/3),excessive_nesting, andallow_attributes_without_reason.Suppressions
None. The template code already passes the new rules.
Checks run
lefthook run pre-commit --all-files(ls-lint, file-length, deadnix, statix, nixfmt, fmt, clippy): passcargo clippy -- -D warnings: passcargo fmt --check: passcargo test: passcargo machete: passcargo deny check bans licenses sources: pass (theadvisoriescheck could not run locally because the sandbox makes~/.cargo/advisory-dbsread-only; CI covers it)Refs furedea/dotfiles#213
🤖 Generated with Claude Code