Skip to content

Let the pinned formatter have the line it wants in settings.py - #11371

Merged
danielhanchen merged 1 commit into
mainfrom
ci/formatter-fixed-point-11370
Sep 20, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/formatter-fixed-point-11370

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

main is not a fixed point of its own formatting hook again, so pre-commit.ci - pr is red on every open pull request and tests/test_formatter_fixed_point.py::test_every_tracked_python_file_is_already_formatted fails on main itself.

What happened

#11370 added _validate_sidebar_nav_auto to studio/backend/routes/settings.py with its signature wrapped across three lines. The pinned hook collapses it, because the single-line form is 90 characters and fits:

    @field_validator("sidebarNavAuto")
    @classmethod
-    def _validate_sidebar_nav_auto(
-        cls, value: Optional[list[str]]
-    ) -> Optional[list[str]]:
+    def _validate_sidebar_nav_auto(cls, value: Optional[list[str]]) -> Optional[list[str]]:

That is the whole change. No behaviour is touched.

This is the same shape as the one #11348 fixed: the hook runs on the files a pull request touches, so a file that lands unformatted is never looked at again, and the next author to edit settings.py inherits a red check for a diff they did not write.

Verification

The guard that catches this already exists and was working; it just needs the tree to agree with it.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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-20T12:28:42.922738Z 84939f1 Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 84939f1a9b

ℹ️ 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".

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".

@danielhanchen
danielhanchen merged commit d7cec5f into main Sep 20, 2026
46 of 49 checks passed
@danielhanchen
danielhanchen deleted the ci/formatter-fixed-point-11370 branch September 20, 2026 13:49
danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Sep 20, 2026
…11372)

* Format the validator unslothai#11370 added, so pre-commit.ci is green again

`ruff-format-with-kwargs` runs over the whole tree, so one unformatted
signature fails the hook on every open PR rather than only on the one that
introduced it. `_validate_sidebar_nav_auto` fits on a single line under the
pinned ruff 0.6.9, and this is exactly the output of
`python scripts/run_ruff_format.py studio/backend/routes/settings.py`.

* Give the desktop release tests an explicit utf-8 encoding

The repo's own guard in tests/security fails any read of a checked-in file at
the platform default encoding, because it breaks on Windows the moment that
file gains a non-ASCII byte. Three reads added with the desktop release work
were missing it, which fails `Repo tests (CPU, rest)` on every PR opened
against current main, unslothai#11371 and unslothai#11372 included.
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…11372)

* Format the validator unslothai#11370 added, so pre-commit.ci is green again

`ruff-format-with-kwargs` runs over the whole tree, so one unformatted
signature fails the hook on every open PR rather than only on the one that
introduced it. `_validate_sidebar_nav_auto` fits on a single line under the
pinned ruff 0.6.9, and this is exactly the output of
`python scripts/run_ruff_format.py studio/backend/routes/settings.py`.

* Give the desktop release tests an explicit utf-8 encoding

The repo's own guard in tests/security fails any read of a checked-in file at
the platform default encoding, because it breaks on Windows the moment that
file gains a non-ASCII byte. Three reads added with the desktop release work
were missing it, which fails `Repo tests (CPU, rest)` on every PR opened
against current main, unslothai#11371 and unslothai#11372 included.
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