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

Retain extra ellipses in protocols and abstract methods #8769

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

charliermarsh
Copy link
Member

Summary

It turns out that some type checkers rely on the presence of ellipses in Protocol interfaces and abstract methods, in order to differentiate between default implementations and stubs. This PR modifies the preview behavior of PIE790 to avoid flagging "unnecessary" ellipses in such cases.

Closes #8756.

Test Plan

cargo test

@charliermarsh charliermarsh added the bug Something isn't working label Nov 19, 2023
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -24 violations, +0 -0 fixes in 41 projects)

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

ruff check --no-cache --exit-zero --select ALL --preview

- airflow/hooks/base.py:168:9: PIE790 [*] Unnecessary `...` literal
- airflow/hooks/base.py:188:9: PIE790 [*] Unnecessary `...` literal
- airflow/metrics/protocols.py:40:9: PIE790 [*] Unnecessary `...` literal
- airflow/metrics/protocols.py:44:9: PIE790 [*] Unnecessary `...` literal
- airflow/notifications/basenotifier.py:81:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/batch_client.py:125:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/batch_client.py:137:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/batch_client.py:68:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/batch_client.py:94:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/ecs.py:159:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/ecs.py:166:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/ecs.py:173:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/ecs.py:180:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/ecs.py:187:9: PIE790 [*] Unnecessary `...` literal
- airflow/providers/amazon/aws/hooks/ecs.py:194:9: PIE790 [*] Unnecessary `...` literal
- airflow/serialization/json_schema.py:43:9: PIE790 [*] Unnecessary `...` literal
- airflow/serialization/json_schema.py:47:9: PIE790 [*] Unnecessary `...` literal
- airflow/serialization/json_schema.py:51:9: PIE790 [*] Unnecessary `...` literal

ibis-project/ibis (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- ibis/common/patterns.py:208:9: PIE790 [*] Unnecessary `...` literal

scikit-build/scikit-build-core (+0 -5 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- src/scikit_build_core/settings/sources.py:154:9: PIE790 [*] Unnecessary `...` literal
- src/scikit_build_core/settings/sources.py:161:9: PIE790 [*] Unnecessary `...` literal
- src/scikit_build_core/settings/sources.py:169:9: PIE790 [*] Unnecessary `...` literal
- src/scikit_build_core/settings/sources.py:177:9: PIE790 [*] Unnecessary `...` literal
- src/scikit_build_core/settings/sources.py:184:9: PIE790 [*] Unnecessary `...` literal

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PIE790 24 0 24 0 0

@charliermarsh
Copy link
Member Author

The ecosystem changes are correct (they were false positives given this new information).

@charliermarsh charliermarsh merged commit 95e2f63 into main Nov 19, 2023
17 checks passed
@charliermarsh charliermarsh deleted the charlie/pie branch November 19, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in PIE790 in Ruff v0.1.6 (... is meaningful in protocol methods and should not be removed)
1 participant