Repository navigation
Format main to its own pinned hook, so pre-commit autofix can land again - #11019
Merged
Merged
Conversation
main is not formatted the way its own pre-commit hook formats. Running scripts/run_ruff_format.py with the pinned ruff 0.6.9 over every file the hook selects changes three files on 52fb7b0: studio/backend/tests/test_diffusers_prewarm.py (#10989) studio/backend/utils/torch_warmup.py (#10989) tests/python/test_amd_extras_contract.py (#7536) Both of those PRs merged in the last hour with `pre-commit.ci - pr` in ERROR. That is not only a tidiness problem, because it takes pre-commit.ci's autofix down for every OTHER pull request. The hook runs against the PR merged with main, so every PR's tree now contains these three files needing reformatting; the autofix patch is computed over them and then cannot be applied to a head that does not carry main's copy. Three PRs are red on exactly that, each with a one-or-two-line formatting delta it cannot self-heal, all reporting: a conflict occurred when applying fixes to the pr. try pulling the upstream branch So this is self-sustaining: unformatted code on main disables the autofix, and PRs then merge red because nothing can push the fix for them. The formatter, not the code, is the thing to trust here: it is pinned in .pre-commit-config.yaml, and it is idempotent. Running it again over these files changes nothing on the second or third pass, so this is a fixed point rather than one step of a moving target. One hunk expands a short signature, which looks wrong until you see why: the hook rewrites `path=None` to `path = None` first, and the longer line then no longer fits. Nothing but whitespace: comment_tools.py check --strict-ext reports 3/3 OK, so every AST is unchanged. test_diffusers_prewarm.py 28 passed, test_amd_extras_contract.py 10 passed. Re-running the hook over the whole tree afterwards touches these three files and nothing else.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Sep 15, 2026
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…ain (unslothai#11019) main is not formatted the way its own pre-commit hook formats. Running scripts/run_ruff_format.py with the pinned ruff 0.6.9 over every file the hook selects changes three files on 52fb7b0: studio/backend/tests/test_diffusers_prewarm.py (unslothai#10989) studio/backend/utils/torch_warmup.py (unslothai#10989) tests/python/test_amd_extras_contract.py (unslothai#7536) Both of those PRs merged in the last hour with `pre-commit.ci - pr` in ERROR. That is not only a tidiness problem, because it takes pre-commit.ci's autofix down for every OTHER pull request. The hook runs against the PR merged with main, so every PR's tree now contains these three files needing reformatting; the autofix patch is computed over them and then cannot be applied to a head that does not carry main's copy. Three PRs are red on exactly that, each with a one-or-two-line formatting delta it cannot self-heal, all reporting: a conflict occurred when applying fixes to the pr. try pulling the upstream branch So this is self-sustaining: unformatted code on main disables the autofix, and PRs then merge red because nothing can push the fix for them. The formatter, not the code, is the thing to trust here: it is pinned in .pre-commit-config.yaml, and it is idempotent. Running it again over these files changes nothing on the second or third pass, so this is a fixed point rather than one step of a moving target. One hunk expands a short signature, which looks wrong until you see why: the hook rewrites `path=None` to `path = None` first, and the longer line then no longer fits. Nothing but whitespace: comment_tools.py check --strict-ext reports 3/3 OK, so every AST is unchanged. test_diffusers_prewarm.py 28 passed, test_amd_extras_contract.py 10 passed. Re-running the hook over the whole tree afterwards touches these three files and nothing else.
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.
main is not formatted the way its own hook formats
Running
scripts/run_ruff_format.pywith the pinned ruff 0.6.9 over every file the hook selects changes three files on52fb7b035:studio/backend/tests/test_diffusers_prewarm.pystudio/backend/utils/torch_warmup.pytests/python/test_amd_extras_contract.pyBoth merged within the last hour with
pre-commit.ci - prin ERROR.Why this is not just tidiness
It takes pre-commit.ci's autofix down for every other pull request.
The hook runs against the PR merged with main, so every open PR's tree now carries these three files needing reformatting. The autofix patch is computed over that tree and then cannot be applied to a head that does not carry main's copy of them. Three PRs are currently red on exactly this, each with a one-or-two-line formatting delta it cannot self-heal, all reporting the same thing:
The loop is self-sustaining. Unformatted code on main disables the autofix, and PRs then merge red because nothing can push the fix for them, which is how the second of the two offending merges got in after the first.
Is the formatter right, or is the code?
The formatter, on two counts.
It is pinned in
.pre-commit-config.yaml(ruff==0.6.9), so it is the repo's own definition of formatted, andscripts/run_ruff_format.pyrefuses to run under any other version rather than producing a different answer.And it is idempotent. Re-running it over these files changes nothing on the second or third pass, so this is a fixed point and not one step of a moving target. That mattered, because one hunk looks wrong at a glance:
Ruff would not explode a signature that short. The hook rewrites
path=Nonetopath = Nonefirst, and the longer line then no longer fits. Intended behaviour of the kwarg-spacing wrapper, and stable.Verification
comment_tools.py check --strict-ext: 3/3 OK, so every AST is unchanged and this is whitespace only.studio/backend/tests/test_diffusers_prewarm.py: 28 passed.tests/python/test_amd_extras_contract.py: 10 passed.