Giter Site home page Giter Site logo

Windows support about golangci-lint HOT 5 CLOSED

golangci avatar golangci commented on May 18, 2024 1
Windows support

from golangci-lint.

Comments (5)

syncore avatar syncore commented on May 18, 2024 1

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

from golangci-lint.

syncore avatar syncore commented on May 18, 2024

color

related, perhaps:

fatih/color#91
fatih/color#87

from golangci-lint.

 avatar commented on May 18, 2024

@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

from golangci-lint.

 avatar commented on May 18, 2024

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

from golangci-lint.

thegtproject avatar thegtproject commented on May 18, 2024

@golangci tested. looks good on my end. thanks

from golangci-lint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.