ruff: Add --extend-exclude to ruff format#26372
Conversation
e544212 to
b7a4e96
Compare
|
It seems that I've introduced a new warning in some snapshot tests. That's probably not intended, so I'll have to look into that. I don't know enough about the codebase to know why this is the case, though. |
ntBre
left a comment
There was a problem hiding this comment.
Thanks! This looks reasonable to me compared to the check version. I'll also ping Micha for a review in case it was intentional to exclude these flags, or I'm missing something else.
|
b7a4e96 to
2942a4b
Compare
--show-files and --extend-exclude to ruff format--extend-exclude to ruff format
There was a problem hiding this comment.
This looks good to me. Would you mind adding a regression test in
ruff/crates/ruff/tests/cli/format.rs
Line 830 in 044532a
I assume you mean tests which use |
|
Yes, a test for |
This is a config override just like on `ruff check` and behaves the same, extending the list of paths to exclude instead of ovewriting them. Fixes astral-sh#18980.
2942a4b to
bad3198
Compare
|
Thank you |
Summary
See commit messages.
Closes #18980
Test Plan
At $dayjob I'm working on a repository in which we call ruff/ty with
--extend-excludebecause of various reasons. I uninstalled the version of ruff installed by uv and tested this installation, and it did what I expected.It respected both the default configured excludes in
pyproject.tomland the extended excludes passed via--extend-exclude, which I could confirm with both--show-filesand simply running the check.