Skip to content

chore(ruff): standardize optional union ordering - #10845

Merged
Light2Dark merged 1 commit into
mainfrom
t3code/enable-ruff-none-last
Sep 15, 2026
Merged

Light2Dark merged 1 commit into
mainfrom
t3code/enable-ruff-none-last

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Sep 15, 2026

Copy link
Copy Markdown
Member

This pull request was authored by a coding agent.

📝 Summary

Enable Ruff’s RUF036 check and remove it from the global ignore list.

Optional type unions now place None last, giving annotations a consistent shape and preventing new ordering drift. This is an annotation-only change; unions used by msgspec remain unambiguous because their None branch does not overlap the other variants.

Ruff 0.16.7, focused serialization and export tests, and make check pass.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Written by gpt-5.6-sol on Codex

@Light2Dark Light2Dark added the internal A refactor or improvement that is not user facing label Sep 15, 2026
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 15, 2026 5:17am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Light2Dark
Light2Dark marked this pull request as ready for review September 15, 2026 05:21
Copilot AI lite review requested due to automatic review settings September 15, 2026 05:21
@Light2Dark
Light2Dark enabled auto-merge (squash) September 15, 2026 05:22

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 12 files

Re-trigger cubic

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A remaining RUF036 violation prevents make check from passing.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request standardizes optional union ordering and enables Ruff’s RUF036 check.

Changes:

  • Removes RUF036 from Ruff’s global ignore list.
  • Reorders None in affected unions across 12 Python files.
  • A remaining violation prevents make check from passing.
File summaries
File Description
pyproject.toml Enables RUF036.
marimo/_utils/lists.py Reorders the as_list union.
marimo/_utils/env.py Reorders the environment value union.
marimo/_server/ai/mcp/types.py Reorders the recursive MCP value union.
marimo/_schemas/export.py Reorders the export layout union.
marimo/_save/loaders/lazy.py Reorders loader unions.
marimo/_runtime/packages/import_error_extractors.py Reorders the exception union.
marimo/_runtime/dataflow/graph.py Reorders the graph copy parameter union.
marimo/_output/formatters/structures.py Reorders the formatter return union.
marimo/_messaging/notification.py Reorders the notification serialization union.
marimo/_lint/diagnostic.py Reorders the diagnostic cell ID union.
marimo/_ast/pytest.py Reorders pytest helper parameter unions.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pyproject.toml
@@ -389,7 +389,6 @@ ignore = [
"FURB189", # Subclassing built-in collections
"FURB152", # Replace literal with a math constant
"FURB110", # Replace ternary with an `or` expression
@Light2Dark
Light2Dark merged commit fe51783 into main Sep 15, 2026
55 checks passed
@Light2Dark
Light2Dark deleted the t3code/enable-ruff-none-last branch September 15, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants