You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add instruction to AGENTS.md Coding Standards to always run ruff format and ruff check --fix on Python files immediately after writing or editing them.
Was generative AI tooling used to co-author this PR?
Yes — Claude Opus 4.6 (1M context)
Generated-by: Claude Opus 4.6 (1M context) following the guidelines
potiuk
changed the title
AGENTS: Add instruction to format Python files with ruff after editing
AGENTS: Add instruction to format and check Python files with ruff after editing
Mar 14, 2026
PR checklist already requires running static checks before pushing. Wouldn't running those once before commit/PR be sufficient rather than after every file edit?
Curious if there's a specific failure mode this is targeting that the batch approach doesn't catch.
PR checklist already requires running static checks before pushing. Wouldn't running those once before commit/PR be sufficient rather than after every file edit? Curious if there's a specific failure mode this is targeting that the batch approach doesn't catch.
Yes - ruff is VERY fast and can be done immediately, on the other hand runnig prek for the change takes a bit of time and often what happens when you run the checks after edit they fail first and then the agent looks at the output, re-adds the file and re-runs prek check. This takes usually a bit less than minute more for re-run and I get it practically every time when some files were edited.
By adding ruff at modification time - when everything else is fine, this will result in no rerun needed. So prek will only be run once and succeed. So this is rally an optimisation of speed of processing.
PR checklist already requires running static checks before pushing. Wouldn't running those once before commit/PR be sufficient rather than after every file edit? Curious if there's a specific failure mode this is targeting that the batch approach doesn't catch.
Yes - ruff is VERY fast and can be done immediately, on the other hand runnig prek for the change takes a bit of time and often what happens when you run the checks after edit they fail first and then the agent looks at the output, re-adds the file and re-runs prek check. This takes usually a bit less than minute more for re-run and I get it practically every time when some files were edited.
By adding ruff at modification time - when everything else is fine, this will result in no rerun needed. So prek will only be run once and succeed. So this is rally an optimisation of speed of processing.
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
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.
Add instruction to AGENTS.md Coding Standards to always run
ruff formatandruff check --fixon Python files immediately after writing or editing them.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.6 (1M context) following the guidelines