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

[refurb] Implement for-loop-writes (FURB122) #10630

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

alex-700
Copy link
Contributor

Summary

Implement for-loop-writes (FURB122) lint

Test Plan

cargo test

Copy link
Contributor

github-actions bot commented Mar 27, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

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

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

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

+ dev/breeze/src/airflow_breeze/commands/setup_commands.py:147:21: FURB122 [*] Use of `destination_file.write` in a for loop
+ docs/exts/extra_files_with_substitutions.py:41:17: FURB122 [*] Use of `output_file.write` in a for loop
+ docs/exts/extra_files_with_substitutions.py:51:13: FURB122 [*] Use of `output_file.write` in a for loop
+ providers/src/airflow/providers/amazon/aws/transfers/dynamodb_to_s3.py:233:13: FURB122 [*] Use of `temp_file.write` in a for loop

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

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

+ tests/integration_tests/core_tests.py:443:13: FURB122 Use of `test_file.write` in a for loop

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

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

+ scripts/milestone.py:333:9: FURB122 [*] Use of `out.write` in a for loop

latchbio/latch (+2 -0 violations, +0 -0 fixes)

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

+ src/latch_cli/services/get_params.py:178:9: FURB122 [*] Use of `f.write` in a for loop
+ src/latch_cli/services/get_params.py:180:9: FURB122 [*] Use of `f.write` in a for loop

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

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

+ tools/droplets/add_mentor.py:69:13: FURB122 [*] Use of `f.write` in a for loop
+ zerver/lib/test_helpers.py:572:13: FURB122 [*] Use of `f.write` in a for loop
+ zerver/lib/test_runner.py:306:17: FURB122 [*] Use of `f.write` in a for loop

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

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

+ astropy/samp/lockfile_helpers.py:46:5: FURB122 [*] Use of `lockfile.write` in a for loop

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FURB122 12 12 0 0 0

Copy link
Contributor

@VascoSch92 VascoSch92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice 😊👍

@charliermarsh charliermarsh self-assigned this Mar 28, 2024
@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Mar 28, 2024
@dylwil3 dylwil3 changed the title [refurb] Implement for-loop-writes (FURB122) lint [refurb] Implement for-loop-writes (FURB122) Jan 16, 2025
@dylwil3
Copy link
Collaborator

dylwil3 commented Jan 16, 2025

This is an excellent contribution! Thank you so much, and apologies for the long delay in resolving this PR.

@dylwil3 dylwil3 merged commit 177bf72 into astral-sh:main Jan 16, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants