Skip to content

Comments

Retain extra ellipses in protocols and abstract methods#8769

Merged
charliermarsh merged 1 commit intomainfrom
charlie/pie
Nov 19, 2023
Merged

Retain extra ellipses in protocols and abstract methods#8769
charliermarsh merged 1 commit intomainfrom
charlie/pie

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
@github-actions
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
@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