-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Colorize format --diff
output
#9984
Comments
Def a good first issue! |
Hey @MichaReiser, I'm interested on working on this Edit: But I've also noticed you tagged OP in the original discussion |
@senadev42 nice. I think the original OP doesn't mind if the feature gets implemented by someone else. I assign the issue to you. Let me know if you need any help. Note: We use https://docs.rs/colored/latest/colored/ for colonizing the CLI output. |
Just catching up with this now. Thanks for moving it to an issue. I would like to see this implemented and am more than happy for @senadev42 to work on it. |
@senadev42 is there something I can help you with or would you prefer if someone else takes a look at it? |
@MichaReiser Oh I've just been unexpectedly busy lately but I'm picking away at it, just kind of slowly since I assumed it wasn't an urgent/critical task. I can let go if it is though, since I'm using this as an opportunity to dip my toes into rust. |
@senadev42 it's not urgent. I just wanted to make sure you've all you need :) |
Hey @MichaReiser So I've made a draft PR at #10110 and I'd like some help interpreting why and how some of the tests are failing |
Closed by #10110 |
Discussed in #9983
We should colorize the diff output (added and removed lines).
The relevant code is in
ruff/crates/ruff_linter/src/source_kind.rs
Lines 103 to 111 in a7d1f7e
We probably would need to extract the
to_writer
function and change it so that we set the right color depending on if it's an addition or deletion:Originally posted by ssenior45 February 14, 2024
If I run
ruff check
on a file then the output is colored which leads me to believe that my terminal is configured to display colored output from the tool correctly.However when I run
ruff format --diff
the output is not colored. Is this expected? If so is there anything that can be done about it?Thanks in advance.
The text was updated successfully, but these errors were encountered: