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

Make ruff format idempotent when using stdin input #7581

Merged
merged 1 commit into from Sep 21, 2023

Conversation

leiserfg
Copy link
Contributor

@leiserfg leiserfg commented Sep 21, 2023

Summary

Currently, this happens

$ echo "print()" | ruff format - 

#Notice that nothing went to stdout

Which does not match ruff check --fix - behavior and deletes my code every time I format it (more or less 5 times per minute 😄).

I just checked that my example works as the change was very straightforward.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 21, 2023

CodSpeed Performance Report

Merging #7581 will improve performances by 2.33%

Comparing leiserfg:fix-format-stdin (839a55f) with main (c3774e1)

Summary

⚡ 1 improvements
✅ 24 untouched benchmarks

Benchmarks breakdown

Benchmark main leiserfg:fix-format-stdin Change
linter/all-rules[numpy/ctypeslib.py] 35 ms 34.2 ms +2.33%

@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thank you! This makes sense.

@charliermarsh charliermarsh added the formatter Related to the formatter label Sep 21, 2023
@charliermarsh charliermarsh merged commit 74dbd87 into astral-sh:main Sep 21, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants