GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — [`flake8-pyi`] Mark `PYI061` fixes unsafe in Python files by jesco-absolut · Pull Request #26533 · astral-sh/ruff Conversation
Contributor
SummaryCloses #20729. This marks The fix can rewrite Stub files keep the previous behavior, since they are not runtime Python files: fixes are still safe unless comments are removed. I also added a regression case to the existing Test PlanReproduced the issue before the change: cargo run -p ruff -- check /tmp/pyi061_repro.py --select PYI061 --fix --diff --no-cache --isolated Verified that after the change, the fix is no longer applied by default and is only available with Verified that the fix is still available with unsafe fixes enabled: cargo run -p ruff -- check /tmp/pyi061_repro.py --select PYI061 --fix --diff --unsafe-fixes --no-cache --isolated Ran the targeted snapshot tests: CARGO_PROFILE_DEV_OPT_LEVEL=1 INSTA_FORCE_PASS=1 INSTA_UPDATE=always CARGO_PROFILE_DEV_DEBUG="line-tables-only" MDTEST_UPDATE_SNAPSHOTS=1 cargo test -p ruff_linter rule_redundantnoneliteral_path_new_pyi061 -- --nocapture Also ran: cargo dev generate-all uv run --only-group dev --locked prek run --files crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI061.py crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_none_literal.rs crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.py.snap crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI061_PYI061.pyi.snap crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.py.snap crates/ruff_linter/src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__py38_PYI061_PYI061.pyi.snap git diff --check
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
ntBre
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, this makes sense to me! I just had one suggestion/request about the test location.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. flake8-pyi] Mark PYI061 fixes unsafe in Python files
|
There was an error while loading. Please reload this page.
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PYI061 | 4 | 2 | 2 | 0 | 0 |
ℹ️ ecosystem check detected linter changes. (+4 -4 violations, +0 -0 fixes in 3 projects; 53 projects unchanged)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL
+ airflow-core/src/airflow/serialization/definitions/dag.py:999:36: redundant-none-literal Use `Literal[...] | None` rather than `Literal[None, ...]` - airflow-core/src/airflow/serialization/definitions/dag.py:999:36: redundant-none-literal [*] Use `Literal[...] | None` rather than `Literal[None, ...]`
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ src/latch/types/metadata.py:496:45: redundant-none-literal Use `Optional[Literal[...]]` rather than `Literal[None, ...]` - src/latch/types/metadata.py:496:45: redundant-none-literal [*] Use `Optional[Literal[...]]` rather than `Literal[None, ...]`
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ src/prefect/tasks.py:1882:19: redundant-none-literal Use `None` rather than `Literal[None]` - src/prefect/tasks.py:1882:19: redundant-none-literal [*] Use `None` rather than `Literal[None]` + src/prefect/tasks.py:1919:19: redundant-none-literal Use `None` rather than `Literal[None]` - src/prefect/tasks.py:1919:19: redundant-none-literal [*] Use `None` rather than `Literal[None]`
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| redundant-none-literal | 8 | 4 | 4 | 0 | 0 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Fix for redundant-none-literal (PYI061) is marked as safe but should not be
There was an error while loading. Please reload this page.