Repository navigation
Scope the linter rule to Python and guard the formatters - #2
Merged
Merged
Conversation
The rule made flake8 the only linter for every language, so it forbade shellcheck and left a Go or Rust repository with no allowed linter. It now covers the style linters and the formatters of Python only. The hand-fix mandate applies to the code you add. The read-only forms stay allowed, because `black --check` and `isort --check-only` never write a file. The write forms stay forbidden, and hooks/enforce-rules.sh now denies black, isort, `ruff format`, and `ruff check --fix`. Co-Authored-By: Claude Opus 5 (1M context) <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.
What
The
flake8rule made flake8 the only linter for every language. This scopes it to Python and adds hook enforcement for the formatters.Why
The rule forbade
shellcheck, which this repository needs and its own CI runs. It also left a JavaScript, Go, or Rust repository with no allowed linter, andAGENTS.mdgives a global rule precedence over a repository instruction, so no repository could opt out.Changes
AGENTS.md: the rule now covers the style linters and the formatters of Python only. A linter for another language, a type checker, a manifest validator, and a test runner stay allowed. The hand-fix mandate applies to the code you add, and it carves out an__init__.pyfile and a finding that the formatter of the repository produces.AGENTS.md: the read-only forms stay allowed, becauseblack --check,ruff check, andisort --check-onlynever write a file. The write forms stay forbidden.hooks/enforce-rules.sh: the ban is no longer prose only. The guard deniesblack,isort,ruff format, andruff check --fix. It finds them after a runner, afterpython -m, and afteruvxoruv tool run. A read-only flag counts only in an option position, soblack --exclude --check .stays denied.tests/test-hooks.sh: 49 new cases. The suite passes 222 of 222.Verification
tests/test-hooks.sh: 222 passed, 0 failedshellcheck hooks/*.sh tests/*.sh: cleanbash -non both scripts: clean🤖 Generated with Claude Code