Giter VIP home page Giter VIP logo

Comments (6)

cep21 avatar cep21 commented on July 16, 2024

gofmt prints diffs not lines with issues. I could special case it and find the first line with an issue and print a generic warning about Some kind of gofmt issue on this line. Recommend running gofmt -s -e <filename.go>

Thoughts @alecthomas ?

from gometalinter.

alecthomas avatar alecthomas commented on July 16, 2024

I don't personally use this, but I assumed that one warning per file would be enough? This seems reasonable to me:

gometalinter --linter='gofmt:gofmt -l *.go:^(?P<path>[^\n]+)$' \
  --message-overrides='gofmt:file is not gofmted' \
   --severity=gofmt:warning \
  --disable-all --enable=gofmt

It does make the line number 0, but that could be changed to line 1.

from gometalinter.

jgautheron avatar jgautheron commented on July 16, 2024

@cep21 I just added support for goimports (always has been in my toolchain with gofmt).
Can you tell me if you're working on this? if not I'd gladly throw a PR as well.

from gometalinter.

cep21 avatar cep21 commented on July 16, 2024

Please submit one!

from gometalinter.

jgautheron avatar jgautheron commented on July 16, 2024

Done! does the current implementation fit your needs?

from gometalinter.

cep21 avatar cep21 commented on July 16, 2024

Yeap! Best we can easily do since it outputs diffs.

from gometalinter.

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.