Skip to content

Order NoneArg's union so make lint passes - #6

Open
tamohannes wants to merge 1 commit into
nustackdev:mainfrom
tamohannes:fix/ruff-none-union-order
Open

Order NoneArg's union so make lint passes#6
tamohannes wants to merge 1 commit into
nustackdev:mainfrom
tamohannes:fix/ruff-none-union-order

Conversation

@tamohannes

Copy link
Copy Markdown

make lint is red on a clean clone, one error:

RUF036 `None` not at the end of the type union
  --> src/nu/lang/args.py:68
   |
68 | NoneArg: TypeAlias = "None | Nu[None] | Any | Sentinel"

Moved None to the end. The alias is a quoted annotation, so the order carries no runtime or typing meaning.

The cost is symmetry: every sibling alias puts the bare type first ("int | Nu[int] | Any | Sentinel"), and NoneArg no longer reads that way. If you would rather keep the column lined up, # noqa: RUF036 on that line is the other option and I am happy to switch it.

make lint passes with this. ruff format --check still reports 3 files, all python blocks inside markdown, untouched here.

Note that make test is still red on this branch: 5 failures, unrelated to this change, fixed in #4.

🤖 Generated with Claude Code

`make lint` fails on a clean clone with one error:

    RUF036 `None` not at the end of the type union
      --> src/nu/lang/args.py:68

Move `None` to the end of the alias. It costs the symmetry with the sibling
aliases, which all put the bare type first, but the alias is a quoted
annotation so the order carries no runtime or typing meaning.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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