Skip to content

Studio: put the sidebar nav validator signature on the line the formatter wants - #11374

Merged
danielhanchen merged 1 commit into
mainfrom
studio-format-sidebar-nav-validator
Sep 20, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-format-sidebar-nav-validator

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What is wrong

pre-commit.ci has been failing on main since #11370, and every open pull request inherits the red check.

The failing hook is ruff-format-with-kwargs, and it fails with files were modified by this hook. The log's 1287 files reformatted, 81 files left unchanged is ruff's own summary from inside the script, not the verdict: scripts/run_ruff_format.py runs ruff format and then restores the kwarg spacing, so almost all of those come back byte for byte. Exactly one file does not.

sidebarNavAuto's validator landed with its signature wrapped across three lines:

    def _validate_sidebar_nav_auto(
        cls, value: Optional[list[str]]
    ) -> Optional[list[str]]:

On one line it is 91 characters, inside the configured line-length = 100, so the formatter unwraps it on every run, the tree comes back modified and the hook fails. On a fork-hosted branch pre-commit.ci cannot push its own fix either, so the failure has nowhere to go.

The fix

Put the signature on one line, which is what the hook produces.

How this was confirmed

Reproduced with the same environment the runner uses, which the run log names as [email protected] and local:ruff==0.6.9. The Python version matters here: under 3.11 the script moves 53 files and the real defect is buried in the noise, under 3.14 it moves exactly one.

files the hook rewrites
main at ad16046c 1, studio/backend/routes/settings.py
this branch 0

Re-running the hook after the change leaves settings.py byte identical (same sha256 before and after), so it is a fixed point rather than merely quieter. ruff check on the file passes and it parses.

The first red commit on main is 63c63415a, and git log -S _validate_sidebar_nav_auto names that same commit as the one that introduced the signature, so cause and symptom agree.

…tter wants

The sidebarNavAuto validator landed with its signature wrapped across three
lines. It fits in one at the configured line length of 100, so the
ruff-format-with-kwargs hook rewrites it on every run, reports "files were
modified by this hook" and fails.

That is why pre-commit.ci has been red on main since #11370, and why every open
pull request inherits a red check it did nothing to cause. On a fork-hosted
branch the bot cannot push its own fix either, so the failure just sits there.

Running the hook after this change leaves the tree untouched.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T13:07:21.978655Z 2980994 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen
danielhanchen merged commit 9ec0625 into main Sep 20, 2026
38 of 40 checks passed
@danielhanchen
danielhanchen deleted the studio-format-sidebar-nav-validator branch September 20, 2026 13:24
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…tter wants (unslothai#11374)

The sidebarNavAuto validator landed with its signature wrapped across three
lines. It fits in one at the configured line length of 100, so the
ruff-format-with-kwargs hook rewrites it on every run, reports "files were
modified by this hook" and fails.

That is why pre-commit.ci has been red on main since unslothai#11370, and why every open
pull request inherits a red check it did nothing to cause. On a fork-hosted
branch the bot cannot push its own fix either, so the failure just sits there.

Running the hook after this change leaves the tree untouched.
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