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

[ruff] Stabilize: Detect attrs dataclasses (RUF008, RUF009) #15345

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jan 8, 2025

Summary

This PR stabilizes the rule changes introduced in #14327

Test Plan

There are a few open issues for RUF009 and one that affects both RUF008 and RUF009:

The ecosystem changes look good to me

@MichaReiser MichaReiser changed the title [ruff] Stabilize: Detect attrs dataclasses (RUF008, RUF009) [ruff] Stabilize: Detect attrs dataclasses (RUF008, RUF009) Jan 8, 2025
@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Jan 8, 2025
@MichaReiser MichaReiser added this to the v0.9 milestone Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

ruff-ecosystem results

Linter (stable)

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

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

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

+ airflow/lineage/entities.py:64:23: RUF008 Do not use mutable default values for dataclass attributes
- airflow/lineage/entities.py:64:23: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
+ airflow/lineage/entities.py:86:23: RUF008 Do not use mutable default values for dataclass attributes
- airflow/lineage/entities.py:86:23: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
+ airflow/lineage/entities.py:88:29: RUF008 Do not use mutable default values for dataclass attributes
- airflow/lineage/entities.py:88:29: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
+ airflow/lineage/entities.py:89:26: RUF008 Do not use mutable default values for dataclass attributes
- airflow/lineage/entities.py:89:26: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
+ airflow/lineage/entities.py:90:29: RUF008 Do not use mutable default values for dataclass attributes
- airflow/lineage/entities.py:90:29: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
+ airflow/models/dag.py:430:25: RUF009 Do not perform function call in dataclass defaults
+ airflow/models/dag.py:431:24: RUF009 Do not perform function call `airflow_conf.get_mandatory_value` in dataclass defaults
+ providers/src/airflow/providers/papermill/operators/papermill.py:42:31: RUF008 Do not use mutable default values for dataclass attributes
- providers/src/airflow/providers/papermill/operators/papermill.py:42:31: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`

reflex-dev/reflex (+4 -0 violations, +0 -0 fixes)

+ tests/units/test_attribute_access_type.py:303:27: RUF008 Do not use mutable default values for dataclass attributes
+ tests/units/test_attribute_access_type.py:304:27: RUF008 Do not use mutable default values for dataclass attributes
+ tests/units/test_attribute_access_type.py:307:31: RUF008 Do not use mutable default values for dataclass attributes
+ tests/units/test_attribute_access_type.py:308:36: RUF008 Do not use mutable default values for dataclass attributes

Changes by rule (3 rules affected)

code total + violation - violation + fix - fix
RUF008 10 10 0 0 0
RUF012 6 0 6 0 0
RUF009 2 2 0 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser merged commit ffe2ba3 into ruff-0.9 Jan 8, 2025
21 checks passed
@MichaReiser MichaReiser deleted the micha/attrs-dataclasses branch January 8, 2025 11:57
@MichaReiser MichaReiser mentioned this pull request Jan 8, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants