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

Add flag --no-color #20

Merged
merged 2 commits into from
May 15, 2018
Merged

Add flag --no-color #20

merged 2 commits into from
May 15, 2018

Conversation

breml
Copy link
Contributor

@breml breml commented May 14, 2018

Fixes: #17

@breml
Copy link
Contributor Author

breml commented May 14, 2018

Added tests for --no-color flag. The commit does also include a little refactoring of the tests. To clean the tests even more I suggest to search the output (with or without colors) for the same expected strings like:

  • Found Non-Approved license
  • github.com/fake/package

A solution would be needed for the error level, because it is differently written. With colors, it is 4 upper case letters, without colors it is the full word in lowercase.

Additionally I suggest to sort the output of GetLicenses (https://github.com/frapposelli/wwhrd/blob/master/cli.go#L69 and https://github.com/frapposelli/wwhrd/blob/master/cli.go#L106) before returning it, which would make testing much easier, because the output would be always the same (which is currently not the case due to the random order of traversal of maps in Go).

@frapposelli frapposelli merged commit a471589 into frapposelli:master May 15, 2018
@frapposelli
Copy link
Owner

thanks!

@breml breml deleted the no-color branch May 15, 2018 13:36
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

Successfully merging this pull request may close these issues.

2 participants