Skip to content
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

Build fails #97

Closed
jonas054 opened this issue Apr 25, 2013 · 3 comments
Closed

Build fails #97

jonas054 opened this issue Apr 25, 2013 · 3 comments

Comments

@jonas054
Copy link
Collaborator

Many specs from cli_spec.rb are failing currently. See Travis-CI. This started with the introduction of the Coveralls code coverage gem.

All the failing specs fail for the same reason. A colored text is uncolored, which doesn't work, and then compared to an expected string without ANSI escape sequences. The comparison fails.

First I thought that the reason was that Coveralls and RuboCop both use ANSI coloring, but that they use different gems to achieve this. I tried changing RuboCop to use colorize (used by Coveralls) instead of term-ansicolor. That didn't help one bit.

Since it's the calls to String#uncolored that don't work, we could remove them and colorize all the expected strings instead. This fails to address the root cause, but it works. Should I implement this solution, or can anybody else find a better, more thorough solution?

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 25, 2013

colorize patches String as well and that's causing the breakage. The proper way to fix this would be to remove the term-ansicolor mixin from String and introduce some helper methods instead (that might even understand a --no-color flag). We might also report an issue to coveralls - colorize is pretty buggy so they might consider replacing it... I wasn't able to make it uncolourize text at all. I noticed somebody reported a bug regarding coveralls + colorized a month ago, but it hasn't been addressed. I'll take care of this tomorrow if I can.

jonas054 added a commit to jonas054/rubocop that referenced this issue Apr 25, 2013
This solves issue rubocop#97, the problem with String#uncolored not working
due to interference from the colorize gem used by Coveralls.
@jonas054
Copy link
Collaborator Author

I took care of it based on your description. I hope you think it's OK. I just removed the "monkey patching" and didn't add helper methods.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 25, 2013

Looks good. We can always improve this in the future.

@bbatsov bbatsov closed this as completed Apr 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants