-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 analyze graph | head -n 10
panics
#13442
Comments
That's probably due to a println usage. We should use writeln instead and propagate the error when the pipe breaks |
Just a suggestion to not propagate pipe "errors", as this is not really an error in the normal sense |
I got it. |
This is how ripgrep handles pipe errors: https://github.com/BurntSushi/ripgrep/blob/bf63fe8f258afc09bae6caa48f0ae35eaf115005/crates/core/main.rs#L55-L61 There are other approaches, but this is my favorite because:
But yes, basically any |
## Summary I think we should also make the change that @BurntSushi recommended in the linked issue, but this gets rid of the panic. See: #13483 See: #13442 ## Test Plan ``` warning: `ruff analyze graph` is experimental and may change without warning { "/Users/crmarsh/workspace/django/django/__init__.py": [ "/Users/crmarsh/workspace/django/django/apps/__init__.py", "/Users/crmarsh/workspace/django/django/conf/__init__.py", "/Users/crmarsh/workspace/django/django/urls/__init__.py", "/Users/crmarsh/workspace/django/django/utils/log.py", "/Users/crmarsh/workspace/django/django/utils/version.py" ], "/Users/crmarsh/workspace/django/django/__main__.py": [ "/Users/crmarsh/workspace/django/django/core/management/__init__.py" ruff failed Cause: Broken pipe (os error 32) ```
It seems like
ruff analyze graph
is sometimes unhappy when its output isn't fully consumed.Tested with ruffs 0.6.6 and 0.6.7:
A full example to reproduce, starting in an otherwise empty directory, would be:
git clone https://github.com/Eomys/pyleecan.git --depth=1 uv init uv add ruff==0.6.7 uv run ruff analyze graph | head -n 10
edit: above is running on MacOS 14.6.1 . Although
head
is the GNU version from homebrew's coreutilsThe text was updated successfully, but these errors were encountered: