Skip to content

Ruff 0.7#13679

Merged
AlexWaygood merged 7 commits intomainfrom
ruff-0.7
Oct 17, 2024
Merged

Ruff 0.7#13679
AlexWaygood merged 7 commits intomainfrom
ruff-0.7

Conversation

@AlexWaygood
Copy link
Copy Markdown
Member

Summary

Feature branch for the Ruff 0.7 release

@AlexWaygood AlexWaygood marked this pull request as ready for review October 8, 2024 11:49
@AlexWaygood AlexWaygood added breaking Breaking API change release Related to the release process labels Oct 8, 2024
@AlexWaygood AlexWaygood self-assigned this Oct 8, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 8, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+25 -7 violations, +0 -0 fixes in 7 projects; 47 projects unchanged)

apache/airflow (+14 -2 violations, +0 -0 fixes)

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

+ airflow/providers/amazon/aws/hooks/s3.py:1450:20: SIM115 Use a context manager for opening files
+ airflow/providers/amazon/aws/transfers/dynamodb_to_s3.py:247:29: SIM115 Use a context manager for opening files
+ airflow/providers/cncf/kubernetes/hooks/kubernetes.py:495:9: TRY203 Remove exception handler; error is immediately re-raised
- airflow/providers/cncf/kubernetes/hooks/kubernetes.py:495:9: TRY302 Remove exception handler; error is immediately re-raised
+ airflow/providers/cncf/kubernetes/operators/pod.py:808:9: TRY203 Remove exception handler; error is immediately re-raised
- airflow/providers/cncf/kubernetes/operators/pod.py:808:9: TRY302 Remove exception handler; error is immediately re-raised
+ airflow/providers/docker/operators/docker.py:487:19: SIM115 Use a context manager for opening files
+ airflow/providers/google/cloud/hooks/cloud_sql.py:934:22: SIM115 Use a context manager for opening files
+ airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:195:27: SIM115 Use a context manager for opening files
+ airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:212:35: SIM115 Use a context manager for opening files
+ airflow/providers/google/cloud/transfers/cassandra_to_gcs.py:228:34: SIM115 Use a context manager for opening files
+ airflow/providers/google/cloud/transfers/sql_to_gcs.py:354:27: SIM115 Use a context manager for opening files
+ airflow/providers/google/cloud/transfers/sql_to_gcs.py:465:34: SIM115 Use a context manager for opening files
... 4 additional changes omitted for rule SIM115

apache/superset (+5 -0 violations, +0 -0 fixes)

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

+ superset/commands/dataset/importers/v1/utils.py:198:16: SIM115 Use a context manager for opening files
+ tests/integration_tests/email_tests.py:160:22: SIM115 Use a context manager for opening files
+ tests/integration_tests/email_tests.py:44:22: SIM115 Use a context manager for opening files
+ tests/integration_tests/email_tests.py:64:22: SIM115 Use a context manager for opening files
+ tests/integration_tests/email_tests.py:95:22: SIM115 Use a context manager for opening files

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

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

+ tests/support/util/filesystem.py:133:9: SIM115 Use a context manager for opening files
+ tests/support/util/filesystem.py:151:9: SIM115 Use a context manager for opening files
+ tests/unit/bokeh/command/test_util__command.py:72:9: SIM115 Use a context manager for opening files

python-poetry/poetry (+1 -0 violations, +0 -0 fixes)

+ src/poetry/inspection/lazy_wheel.py:278:41: SIM115 Use a context manager for opening files

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

+ reflex/utils/prerequisites.py:722:14: SIM115 Use a context manager for opening files

zulip/zulip (+1 -0 violations, +0 -0 fixes)

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

+ zerver/management/commands/backup.py:124:36: SIM115 Use a context manager for opening files

indico/indico (+0 -5 violations, +0 -0 fixes)

- indico/modules/events/export.py:151:75: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
- indico/modules/events/export.py:416:59: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
- indico/modules/events/static/offline.py:91:42: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
- indico/modules/events/util.py:710:91: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
- indico/modules/users/export.py:79:87: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)

Changes by rule (4 rules affected)

code total + violation - violation + fix - fix
SIM115 23 23 0 0 0
RUF100 5 0 5 0 0
TRY203 2 2 0 0 0
TRY302 2 0 2 0 0

Linter (preview)

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

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

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

+ airflow/providers/cncf/kubernetes/hooks/kubernetes.py:495:9: TRY203 Remove exception handler; error is immediately re-raised
- airflow/providers/cncf/kubernetes/hooks/kubernetes.py:495:9: TRY302 Remove exception handler; error is immediately re-raised
+ airflow/providers/cncf/kubernetes/operators/pod.py:808:9: TRY203 Remove exception handler; error is immediately re-raised
- airflow/providers/cncf/kubernetes/operators/pod.py:808:9: TRY302 Remove exception handler; error is immediately re-raised

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
TRY203 2 2 0 0 0
TRY302 2 0 2 0 0

MichaReiser and others added 3 commits October 8, 2024 13:40
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Closes #12041
…config section is empty (`PT001`, `PT023`) (#13292)
…` to work with other standard-library IO modules (`SIM115`) (#13680)

Closes #7313.
@AlexWaygood AlexWaygood added this to the v0.7 milestone Oct 8, 2024
@zanieb
Copy link
Copy Markdown
Member

zanieb commented Oct 8, 2024

@Skylion007
Copy link
Copy Markdown
Contributor

Any rules leaving preview on this release? Instead of just behaviors?

@AlexWaygood
Copy link
Copy Markdown
Member Author

Any rules leaving preview on this release? Instead of just behaviors?

Just behaviour changes this release, I'm afraid. It's quite a busy month for us, and reviewing whether a rule is ready to leave preview takes up a lot of time 🙂

We should be able to stabilise some rules in next month's minor release

@AlexWaygood
Copy link
Copy Markdown
Member Author

Interesting SIM115 false positive

bokeh/bokeh@829b2a7/tests/support/util/filesystem.py#L129-L138

and another

python-poetry/poetry@500a313/src/poetry/inspection/lazy_wheel.py#L278

(We chatted about this a bit off GitHub, but just to respond here so others can see -- my feeling is that the accuracy of the rule probably could be improved here, but that these aren't serious enough to delay stabilising the new behaviour. I think it's also sort-of surfacing existing edge cases in the rule rather than this being a new bug that's introduced by the stabilisation. So I'm going to go ahead for now.)

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

Labels

breaking Breaking API change release Related to the release process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants