-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Rubocop explodes :\ #497
Comments
Also there seems to be a bug with ansi escape sequence redirection (I redirected stderr to a file in this case) |
I'm on it :-) There's no bug with the redirection - the odd sequences are ANSI colour codes. |
Ah really awesome, thanks! I'm aware of ANSI escape sequences, but they shouldn't be printed when the output is a file. A check for |
Hum, I see the problem. Rainbow only checks for |
Open a ticket there and we'll see. |
Actually I've tried to tackle the problem with escape sequences before. However RuboCop supports multiple formatters (i.e. multiple outputs), and |
So, Cape-Cod doesn't monkey patch string by default. The issue is that Rainbow disables itself if it sees that stdout is not tty. This approach - used in cape-cod and a lot of other gems as well - is brittle. Maybe we could have a colorizer instance that gets a stream passed and only adds ansi sequences if that's a tty? |
I'm no expert on the subject, so I'm open to suggestions. I've tried |
👍 |
I have just released a new rainbow 1.99 which has this fixed (checks if any of stdout and stderr is not a tty). rainbow will drop monkey patching of String class in 2.0 and this 1.99 release is a preparation for that. You can now upgrade to 1.99 and convert all |
This is the codebase: https://github.com/fuadsaud/bis
The text was updated successfully, but these errors were encountered: