Format the mmproj placement policy tests so pre-commit stops failing every PR by danielhanchen · Pull Request #9414 · unslothai/unsloth · GitHub
Skip to content

Format the mmproj placement policy tests so pre-commit stops failing every PR - #9414

Merged
danielhanchen merged 1 commit into
mainfrom
fix-precommit-mmproj
Aug 20, 2026
Merged

Format the mmproj placement policy tests so pre-commit stops failing every PR#9414
danielhanchen merged 1 commit into
mainfrom
fix-precommit-mmproj

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What

Run the repo's own ruff-format-with-kwargs hook over
studio/backend/tests/test_mmproj_placement_policy.py. Formatting only: two test signatures
rejoined onto one line, one call rejoined, and one blank line after a function-local import
removed.

Why

pre-commit.ci currently fails on main, so it fails on every open pull request whose merge
includes main, regardless of what that pull request changes. #9400 changes four TypeScript files
and no Python at all, and still fails this check.

The hook's failure mode is "files were modified by this hook", and one modified file is enough to
fail the whole run, so the result reads as a repo-wide formatting problem when it is a single file.

How this was pinned down

On a clean worktree at origin/main, running the hook's own entry point over every Python file it
selects (git ls-files '*.py' minus the hook's exclude pattern, 3,000-odd files) leaves exactly
one file modified:

 M studio/backend/tests/test_mmproj_placement_policy.py
 1 file changed, 3 insertions(+), 10 deletions(-)

The file arrived in #9063 and was last touched by #9383.

Checks

  • ruff check on the file: all checks passed
  • the file still parses
  • no behaviour change: no statement is added, removed or reordered

…every PR

The ruff-format-with-kwargs hook rewrites this file, so pre-commit.ci
reports 'files were modified by this hook' and fails. It fails on main
itself, which means it fails on every open pull request whose merge
includes main, whatever that pull request changed: 9400 changes four
TypeScript files and no Python at all, and still fails this check.

Reproduced on a clean worktree at origin/main by running the hook's own
entry point over every Python file it selects. Exactly one file comes
back modified, this one, introduced by #9063 and last touched by #9383.

The change is formatting only: two signatures rejoined onto one line, one
call rejoined, and one blank line after an import removed.
@danielhanchen
danielhanchen merged commit 71bbb05 into main Aug 20, 2026
12 of 31 checks passed
@danielhanchen
danielhanchen deleted the fix-precommit-mmproj branch August 20, 2026 16:44
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.

2 participants