Skip to content

Limit RUF036 to typing contexts; make it unsafe for non-typing-only#23765

Merged
charliermarsh merged 1 commit intomainfrom
charlie/ext
Mar 6, 2026
Merged

Limit RUF036 to typing contexts; make it unsafe for non-typing-only#23765
charliermarsh merged 1 commit intomainfrom
charlie/ext

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

Closes #23763.

@charliermarsh charliermarsh marked this pull request as ready for review March 6, 2026 20:20
@astral-sh-bot astral-sh-bot bot requested a review from amyreese March 6, 2026 20:20
Base automatically changed from charlie/pad to main March 6, 2026 20:28
@charliermarsh charliermarsh enabled auto-merge (squash) March 6, 2026 20:29
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 6, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+4 -3 violations, +0 -90 fixes in 12 projects; 44 projects unchanged)

DisnakeDev/disnake (+0 -1 violations, +0 -2 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- disnake/i18n.py:30:37: RUF036 [*] `None` not at the end of the type union.
+ disnake/i18n.py:30:37: RUF036 `None` not at the end of the type union.
- tests/test_utils.py:775:10: RUF036 [*] `None` not at the end of the type union.

RasaHQ/rasa (+0 -0 violations, +0 -2 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- rasa/shared/core/events.py:597:42: RUF036 [*] `None` not at the end of the type union.
+ rasa/shared/core/events.py:597:42: RUF036 `None` not at the end of the type union.

apache/airflow (+0 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL

- airflow-core/src/airflow/models/dag.py:93:24: RUF036 [*] `None` not at the end of the type union.
- task-sdk/src/airflow/sdk/definitions/dag.py:101:20: RUF036 [*] `None` not at the end of the type union.

bokeh/bokeh (+0 -0 violations, +0 -2 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL

- src/bokeh/embed/standalone.py:84:24: RUF036 [*] `None` not at the end of the type union.
+ src/bokeh/embed/standalone.py:84:24: RUF036 `None` not at the end of the type union.

langchain-ai/langchain (+0 -0 violations, +0 -8 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- libs/langchain/langchain_classic/evaluation/parsing/base.py:152:10: RUF036 [*] `None` not at the end of the type union.
+ libs/langchain/langchain_classic/evaluation/parsing/base.py:152:10: RUF036 `None` not at the end of the type union.
- libs/langchain/langchain_classic/evaluation/parsing/json_distance.py:94:41: RUF036 [*] `None` not at the end of the type union.
+ libs/langchain/langchain_classic/evaluation/parsing/json_distance.py:94:41: RUF036 `None` not at the end of the type union.
- libs/langchain/langchain_classic/evaluation/parsing/json_schema.py:67:41: RUF036 [*] `None` not at the end of the type union.
+ libs/langchain/langchain_classic/evaluation/parsing/json_schema.py:67:41: RUF036 `None` not at the end of the type union.
- libs/langchain/langchain_classic/indexes/_sql_record_manager.py:93:17: RUF036 [*] `None` not at the end of the type union.
+ libs/langchain/langchain_classic/indexes/_sql_record_manager.py:93:17: RUF036 `None` not at the end of the type union.

latchbio/latch (+0 -0 violations, +0 -12 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- src/latch/registry/types.py:38:43: RUF036 [*] `None` not at the end of the type union.
+ src/latch/registry/types.py:38:43: RUF036 `None` not at the end of the type union.
- src/latch/types/metadata.py:419:28: RUF036 [*] `None` not at the end of the type union.
+ src/latch/types/metadata.py:419:28: RUF036 `None` not at the end of the type union.
- src/latch_cli/services/get.py:38:26: RUF036 [*] `None` not at the end of the type union.
+ src/latch_cli/services/get.py:38:26: RUF036 `None` not at the end of the type union.
- src/latch_cli/snakemake/config/utils.py:200:50: RUF036 [*] `None` not at the end of the type union.
+ src/latch_cli/snakemake/config/utils.py:200:50: RUF036 `None` not at the end of the type union.
- src/latch_cli/snakemake/config/utils.py:25:24: RUF036 [*] `None` not at the end of the type union.
+ src/latch_cli/snakemake/config/utils.py:25:24: RUF036 `None` not at the end of the type union.
... 2 additional changes omitted for project

milvus-io/pymilvus (+0 -0 violations, +0 -2 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- pymilvus/client/search_result.py:888:51: RUF036 [*] `None` not at the end of the type union.
+ pymilvus/client/search_result.py:888:51: RUF036 `None` not at the end of the type union.

pandas-dev/pandas (+0 -0 violations, +0 -2 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- pandas/_libs/tslibs/timestamps.pyi:31:25: RUF036 [*] `None` not at the end of the type union.
+ pandas/_libs/tslibs/timestamps.pyi:31:25: RUF036 `None` not at the end of the type union.

python/typeshed (+0 -0 violations, +0 -26 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select E,F,FA,I,PYI,RUF,UP,W

- stdlib/ast.pyi:1096:51: RUF036 [*] `None` not at the end of the type union.
+ stdlib/ast.pyi:1096:51: RUF036 `None` not at the end of the type union.
- stdlib/ast.pyi:1099:51: RUF036 [*] `None` not at the end of the type union.
+ stdlib/ast.pyi:1099:51: RUF036 `None` not at the end of the type union.
- stdlib/asyncio/base_events.pyi:26:26: RUF036 [*] `None` not at the end of the type union.
+ stdlib/asyncio/base_events.pyi:26:26: RUF036 `None` not at the end of the type union.
- stdlib/asyncio/events.pyi:69:26: RUF036 [*] `None` not at the end of the type union.
+ stdlib/asyncio/events.pyi:69:26: RUF036 `None` not at the end of the type union.
- stdlib/email/__init__.pyi:33:26: RUF036 [*] `None` not at the end of the type union.
+ stdlib/email/__init__.pyi:33:26: RUF036 `None` not at the end of the type union.
- stdlib/logging/__init__.pyi:64:27: RUF036 [*] `None` not at the end of the type union.
+ stdlib/logging/__init__.pyi:64:27: RUF036 `None` not at the end of the type union.
- stdlib/subprocess.pyi:62:20: RUF036 [*] `None` not at the end of the type union.
... 13 additional changes omitted for project

reflex-dev/reflex (+4 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ tests/units/components/test_component.py:340:59: RUF100 [*] Unused `noqa` directive (unused: `RUF036`)
+ tests/units/components/test_component.py:370:55: RUF100 [*] Unused `noqa` directive (unused: `RUF036`)
+ tests/units/components/test_component.py:406:59: RUF100 [*] Unused `noqa` directive (unused: `RUF036`)
+ tests/units/components/test_component.py:424:55: RUF100 [*] Unused `noqa` directive (unused: `RUF036`)

zulip/zulip (+0 -0 violations, +0 -30 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL

- confirmation/models.py:143:26: RUF036 [*] `None` not at the end of the type union.
+ confirmation/models.py:143:26: RUF036 `None` not at the end of the type union.
- confirmation/models.py:186:26: RUF036 [*] `None` not at the end of the type union.
+ confirmation/models.py:186:26: RUF036 `None` not at the end of the type union.
- zerver/data_import/microsoft_teams.py:414:23: RUF036 [*] `None` not at the end of the type union.
+ zerver/data_import/microsoft_teams.py:414:23: RUF036 `None` not at the end of the type union.
- zerver/lib/markdown/__init__.py:2007:59: RUF036 [*] `None` not at the end of the type union.
+ zerver/lib/markdown/__init__.py:2007:59: RUF036 `None` not at the end of the type union.
- zerver/lib/markdown/__init__.py:2065:58: RUF036 [*] `None` not at the end of the type union.
+ zerver/lib/markdown/__init__.py:2065:58: RUF036 `None` not at the end of the type union.
- zerver/lib/markdown/__init__.py:2131:59: RUF036 [*] `None` not at the end of the type union.
+ zerver/lib/markdown/__init__.py:2131:59: RUF036 `None` not at the end of the type union.
- zerver/lib/remote_server.py:128:37: RUF036 [*] `None` not at the end of the type union.
+ zerver/lib/remote_server.py:128:37: RUF036 `None` not at the end of the type union.
- zerver/lib/upload/base.py:66:16: RUF036 [*] `None` not at the end of the type union.
... 15 additional changes omitted for project

astropy/astropy (+0 -0 violations, +0 -4 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- astropy/cosmology/_src/core.py:292:41: RUF036 [*] `None` not at the end of the type union.
+ astropy/cosmology/_src/core.py:292:41: RUF036 `None` not at the end of the type union.
- astropy/cosmology/_src/funcs/comparison.py:29:26: RUF036 [*] `None` not at the end of the type union.
+ astropy/cosmology/_src/funcs/comparison.py:29:26: RUF036 `None` not at the end of the type union.

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
RUF036 93 0 3 0 90
RUF100 4 4 0 0 0

@charliermarsh charliermarsh merged commit 724d3b7 into main Mar 6, 2026
42 checks passed
@charliermarsh charliermarsh deleted the charlie/ext branch March 6, 2026 20:33
@amyreese amyreese added rule Implementing or modifying a lint rule preview Related to preview mode features labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RUF036 fix is unsafe and introduces syntax errors

3 participants