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) lint #10630

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alex-700
Copy link
Contributor

Summary

Implement for-loop-writes (FURB122) lint

Test Plan

cargo test

Copy link

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. (+11 -0 violations, +0 -0 fixes in 3 projects; 41 projects unchanged)

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

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

+ airflow/providers/amazon/aws/transfers/dynamodb_to_s3.py:202:13: FURB122 [*] Use of `temp_file.write` in a for loop
+ dev/breeze/src/airflow_breeze/commands/setup_commands.py:146: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
+ tests/dag_processing/test_processor.py:637:13: FURB122 [*] Use of `next_dag.write` in a for loop

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

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

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

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

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

+ tools/droplets/add_mentor.py:70:13: FURB122 [*] Use of `f.write` in a for loop
+ zerver/lib/export.py:1875:13: FURB122 [*] Use of `f.write` in a for loop
+ zerver/lib/test_helpers.py:540:13: FURB122 [*] Use of `f.write` in a for loop
+ zerver/lib/test_runner.py:296:17: FURB122 [*] Use of `f.write` in a for loop
+ zerver/lib/upload/s3.py:234:9: FURB122 [*] Use of `filehandle.write` in a for loop

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FURB122 11 11 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
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.

None yet

3 participants