Skip to content

build(lint): enforce the AGENTS.md size and complexity rules - #7

Merged
furedea merged 1 commit into
mainfrom
build/lint-agents-rules
Oct 18, 2026
Merged

furedea merged 1 commit into
mainfrom
build/lint-agents-rules

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Changes

  • clippy.toml (new): too-many-arguments-threshold = 3, excessive-nesting-threshold = 2, cognitive-complexity-threshold = 15.
  • Cargo.toml [lints.clippy]: warn on allow_attributes_without_reason (restriction), cognitive_complexity (nursery), and excessive_nesting (restriction). too_many_arguments is already on through clippy::all.
  • lefthook.yml: new file-length pre-commit command that rejects staged *.rs files over 500 lines.

Tool versions checked

  • clippy 0.1.91: all three clippy.toml keys are accepted (clippy rejects unknown keys) and all lint names exist. A probe crate with four arguments, three nested ifs, and a reason-less #[allow] triggered too_many_arguments (4/3), excessive_nesting, and allow_attributes_without_reason.
  • lefthook 2.1.15.

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): pass
  • cargo clippy -- -D warnings: pass
  • cargo fmt --check: pass
  • cargo test: pass
  • cargo machete: pass
  • cargo deny check bans licenses sources: pass (the advisories check could not run locally because the sandbox makes ~/.cargo/advisory-dbs read-only; CI covers it)

Refs furedea/dotfiles#213

🤖 Generated with Claude Code

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>
@furedea
furedea merged commit 8d13eeb into main Oct 18, 2026
10 checks passed
@furedea
furedea deleted the build/lint-agents-rules branch October 18, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant