Skip to content

[flake8-pyi] - add autofix for future-annotations-in-stub (PYI044)#12676

Merged
charliermarsh merged 3 commits intoastral-sh:mainfrom
diceroll123:autofix-pyi044
Aug 6, 2024
Merged

[flake8-pyi] - add autofix for future-annotations-in-stub (PYI044)#12676
charliermarsh merged 3 commits intoastral-sh:mainfrom
diceroll123:autofix-pyi044

Conversation

@diceroll123
Copy link
Copy Markdown
Contributor

Summary

add autofix for PYI044

Test Plan

cargo test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 5, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +10 -0 fixes in 2 projects; 52 projects unchanged)

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

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

+ airflow/decorators/__init__.pyi:21:1: PYI044 [*] `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
- airflow/decorators/__init__.pyi:21:1: PYI044 `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
+ airflow/migrations/db_types.pyi:19:1: PYI044 [*] `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
- airflow/migrations/db_types.pyi:19:1: PYI044 `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
+ airflow/utils/context.pyi:27:1: PYI044 [*] `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
- airflow/utils/context.pyi:27:1: PYI044 `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics

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

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

+ src/typings/selenium/webdriver/common/action_chains.pyi:1:1: PYI044 [*] `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
- src/typings/selenium/webdriver/common/action_chains.pyi:1:1: PYI044 `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
+ src/typings/selenium/webdriver/remote/webelement.pyi:1:1: PYI044 [*] `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
- src/typings/selenium/webdriver/remote/webelement.pyi:1:1: PYI044 `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PYI044 10 0 0 10 0

Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Nice! Looks good overall

Comment thread crates/ruff_linter/src/rules/flake8_pyi/rules/future_annotations_in_stub.rs Outdated
Comment thread crates/ruff_linter/src/rules/flake8_pyi/rules/future_annotations_in_stub.rs Outdated
Comment thread crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI044.pyi Outdated
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Aug 5, 2024

CodSpeed Performance Report

Merging #12676 will not alter performance

Comparing diceroll123:autofix-pyi044 (cb3495c) with main (5499821)

Summary

✅ 32 untouched benchmarks

@charliermarsh charliermarsh added fixes Related to suggested fixes for violations preview Related to preview mode features labels Aug 6, 2024
@charliermarsh charliermarsh merged commit 7b5fd63 into astral-sh:main Aug 6, 2024
@charliermarsh
Copy link
Copy Markdown
Member

Thanks @AlexWaygood for the review.

dylwil3 pushed a commit to dylwil3/ruff that referenced this pull request Aug 7, 2024
…4`) (astral-sh#12676)

## Summary

add autofix for `PYI044`

## Test Plan

`cargo test`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations preview Related to preview mode features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants