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

Windows support #14

Closed
thegtproject opened this issue May 26, 2018 · 5 comments
Closed

Windows support #14

thegtproject opened this issue May 26, 2018 · 5 comments

Comments

@thegtproject
Copy link

Console painting issues for windows, e.g.

image

@syncore
Copy link

syncore commented May 26, 2018

color

related, perhaps:

fatih/color#91
fatih/color#87

@golangci
Copy link
Collaborator

@thegtproject @syncore thank you for reporting the issue!
while we're preparing the fix you can use option --out-format to output issues without colors:

golangci-lint run --out-format=line-number

but it doesn't work with golangci-lint linters

@syncore
Copy link

syncore commented May 26, 2018

Thank you and thank you for this useful tool! I was doing some testing locally, and managed to get it to work following issue #91 in the color library linked above. I am not sure if it breaks
on non-Windows so I have kept it local for now, but I will follow your recommendation to use the non-colored out format.

For reference, the modifications I made (there might be better ways to do this, but I was curious to see if I could get it to work at all):

changed fmt.Printf in the printLinterConfigs function at golangci-lint/blob/master/pkg/commands/linters.go:24

to:

fmt.Fprintf(color.Output, "%s: %s [fast: %t]\n", color.YellowString(lc.Linter.Name()), lc.Linter.Desc(), !lc.DoesFullImport)

and doing the same in the executeLinters function at golangci-lint/blob/master/pkg/commands/linters.go:51

fmt.Fprintf(color.Output, "%s: %s\n", color.YellowString(p), strings.Join(linterNames, ", "))

as well as similar changes in golangci\golangci-lint\pkg\printers\text.go:

fmt.Fprintln(stdOut, outStr) to: fmt.Fprintln(color.Output, outStr)

fmt.Fprintf(stdOut, "%s: %s\n", pos, text) to: fmt.Fprintf(color.Output, "%s: %s\n", pos, text)

fmt.Fprintf(stdOut, "%s%s\n", prefix, p.SprintfColored(color.FgYellow, "^")) to: fmt.Fprintf(color.Output, "%s%s\n", prefix, p.SprintfColored(color.FgYellow, "^"))

c1

c2

golangci pushed a commit that referenced this issue May 27, 2018
golangci pushed a commit that referenced this issue May 27, 2018
@golangci
Copy link
Collaborator

@syncore thank you, we fixed by the same way.
check it please

@thegtproject
Copy link
Author

@golangci tested. looks good on my end. thanks

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