-
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
ruff check file.py output is unreadable #3568
Comments
It looks like the color-support detection isn't working. Can you try setting (Reference in docs: https://beta.ruff.rs/docs/faq/#how-can-i-disable-ruffs-color-output) |
(Not sure why it's not working, but we delegate to another library for that: https://crates.io/crates/colored) |
I guess I have to install that colored library too... |
mmm apparently I have to download a 625mb installer to get the docker thing in order to install the colored library!? what? that is a little too much |
No no sorry! You don't need to install that library at all. It's a library that Rust uses under the hood to output the colored escape characters, which many terminals recognize. It's supposed to detect whether your terminal supports those characters, and only output them if it does. In your case, it looks like your terminal doesn't support those characters, but the library is emitting them anyway. (E.g., on my machine, I didn't install that library outside of Ruff, but I do get colored output.) In short: you don't need to install anything, but for whatever reason, it seems you either need to disable color via the environment variable (so that the library doesn't even try to output color), or try in a different terminal. |
that is weird, it display color correctly for other thing like those of pip, and with the colorama library (that is needed for the tqdm to display correctly) also work fine, after calling the removing the environment and trying in the power shell I got the same here is a test script with the colorama
commenting the just_fix_windows_console it display with just_fix_windows_console maybe there is something similar with that colored library too? |
Hmm, I'm not 100% sure -- it says |
There's some commentary in colored-rs/colored#59 where it seems like it doesn't work in some cases on Windows, but that it's not clear when. |
Maybe I should be setting that on Windows? |
well, lets try and see. |
Are you interested in building Ruff locally to test that? |
sure, what I need to do? |
Could you clone this branch (#3583), then run:
|
You'd need to have Rust installed, so if that's too big of a lift, let me know. Maybe someone else can test. |
it is big lift, Rust is very heavy, well the Visual Studio part is, that 950mb in just the c++ compiler or whatever holy molly and if it need the win 11 sdk is 1.5gb DX |
if that branch can be made to be pip installed or similar without needing to install rust I can test it |
Ok thanks, let me create a wheel. |
I created wheels and binaries from that branch here: https://github.com/charliermarsh/ruff/actions/runs/4450737152 You can download them at the bottom, and find the appropriate one for your platform. LMK if that works... |
Woohoo! I'll clean up that PR. |
Can you use Windows Terminal? |
No, Windows Terminal -- it's the more modern alternative to the traditional terminal emulator. I'd recommend using that. It's available via the Windows Store: https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701 |
sure, give me a moment to install it |
Hello, I just hear of this project so I installed to test it, following the usage indication on some file I got this
I installed it like
pip install ruff
ruff version: 0.0.256
Python version 3.11.2
OS: Windows 10
The text was updated successfully, but these errors were encountered: