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

support Windows colors #9

Merged
merged 2 commits into from
Feb 28, 2018
Merged

support Windows colors #9

merged 2 commits into from
Feb 28, 2018

Conversation

mattn
Copy link
Contributor

@mattn mattn commented Feb 28, 2018

What does this do / why do we need it?

git-chglog does not support Windows colors.

How this PR fixes the problem?

be nice

What should your reviewer look out for in this PR?

use go-colorable instead of native os.Stdout/os.Stderr. This doesn't break on Linux or macOS.

Check lists

  • Test passed
  • Coding style (indentation, etc)

Tests on Windows are already broken.

Copy link
Member

@wadackel wadackel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mattn, Thank you for PR 😃
Since there was a point which I became interested in one point I commented on.


Also, the test has failed, but is it possible to fix it?

@@ -30,7 +31,7 @@ func NewInitializer(
return &Initializer{
ctx: ctx,
fs: fs,
logger: NewLogger(ctx.Stdout, ctx.Stderr, false, false),
logger: NewLogger(colorable.NewColorableStdout(), colorable.NewColorableStderr(), false, false),
Copy link
Member

@wadackel wadackel Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to use InitContext.Stdout (and .Stderr) in NewInitializer, but do you have any special reasons?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Reverted this part.

@wadackel wadackel added type: bug Something isn't working type: enhancement New enhancement labels Feb 28, 2018
since InitContext should have Stdout/Stderr which is set as colorable
@coveralls
Copy link

Pull Request Test Coverage Report for Build 27

  • 0 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 72.393%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/git-chglog/main.go 0 4 0.0%
Totals Coverage Status
Change from base Build 24: 0.0%
Covered Lines: 1180
Relevant Lines: 1630

💛 - Coveralls

@wadackel wadackel merged commit 1554e38 into git-chglog:master Feb 28, 2018
@wadackel
Copy link
Member

@mattn Thank you for fixing! merged 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working type: enhancement New enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants