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-0.7] Stabilise the expansion of open-file-with-context-handler to work with other standard-library IO modules (SIM115) #13680

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

AlexWaygood
Copy link
Member

Summary

Stabilises the preview-only changes that were made in #12959. Closes #7313.

These changes were first released in preview as part of Ruff 0.6.2 (released August 22nd). There have been no issues about the changes since then.

Test Plan

cargo test -p ruff_linter --lib + ecosystem report on this PR

…` to work with other standard-library IO modules (`SIM115`)
@AlexWaygood AlexWaygood added the rule Implementing or modifying a lint rule label Oct 8, 2024
@AlexWaygood AlexWaygood added this to the v0.7 milestone Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

ruff-ecosystem results

Linter (stable)

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

apache/airflow (+12 -0 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/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
+ airflow/utils/file.py:159:30: SIM115 Use a context manager for opening files
+ dev/breeze/src/airflow_breeze/utils/kubernetes_utils.py:185:24: SIM115 Use a context manager for opening files
+ dev/breeze/src/airflow_breeze/utils/parallel.py:63:12: SIM115 Use a context manager for opening files

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 (2 rules affected)

code total + violation - violation + fix - fix
SIM115 23 23 0 0 0
RUF100 5 0 5 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood
Copy link
Member Author

The ecosystem report all LGTM from skimming through it, though I'd appreciate a second pair of eyes to make sure I'm not missing any glaring false positives!

@AlexWaygood AlexWaygood merged commit e38914d into ruff-0.7 Oct 8, 2024
20 checks passed
@AlexWaygood AlexWaygood deleted the stabilise-SIM115-behaviour branch October 8, 2024 13:41
AlexWaygood added a commit that referenced this pull request Oct 17, 2024
…` to work with other standard-library IO modules (`SIM115`) (#13680)

Closes #7313.
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