Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

diceroll123
Copy link
Contributor

Summary

add autofix for PYI044

Test Plan

cargo test

Copy link
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
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

Copy link

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
20 checks passed
@charliermarsh
Copy link
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