mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
## Summary When you run Ruff via stdin, and pass `format` or `check --fix`, we typically write the changed or unchanged contents to stdout. It turns out we forgot to do this when the file is _excluded_, so if you run `ruff format /path/to/excluded/file.py`, we don't write _anything_ to `stdout`. This led to a bug in the LSP whereby we deleted file contents for third-party files. The right thing to do here is write back the unchanged contents, as it should always be safe to write the output of stdout back to a file.