Giter Club home page Giter Club logo

Comments (4)

derekperkins avatar derekperkins commented on June 19, 2024 1

Thanks for the feedback.

We don't accept not go/analysis linters.
https://golangci-lint.run/contributing/new-linters/

It looks like most, if not all, linters in golangci-lint require the use of the golang.org/x/tools/go/analysis, which is great news for possible porting.

Another issue with nogo is that it analyzes all Go files in the build. I don't want it to analyze my dependencies, for example.

That's a valid concern for sure. Maybe it has changed since you last looked at it, but now It seems like it should be pretty simple to setup an only_files filter.

image
https://github.com/bazelbuild/rules_go/blob/master/go/nogo.rst#configuring-analyzers

I personally use golant-ci-lint at the moment because it's more convenient to configure linters to ignore certain lines of code using a comment. I think such granularity is not available via nogo, unless I'm just not seeing it in the docs

This is the piece that I'm not sure about, and like you, I haven't been able to see anything indicating that level of granularity.

I've gone ahead and opened an upstream issue in golangci-lint to see if there is interest in adding Bazel support upstream.

from bazel-tools.

ash2k avatar ash2k commented on June 19, 2024 1

Thanks for trying to move this forward! I'll be watching those issues. I'm closing this one as there is nothing to do here in this project.

from bazel-tools.

derekperkins avatar derekperkins commented on June 19, 2024

cc @whizard

from bazel-tools.

ash2k avatar ash2k commented on June 19, 2024

Thanks for the question. I personally don't have any plans to work on such integrations and I'm not aware of any plans someone else might have.

nogo supports plugging in Analyzers so the path forward is to see how the desired linters can be plugged into it.

Looking at golang-ci-lint, for instance, I found that at least some linters (I've checked only two - see https://github.com/golangci/golangci-lint/tree/master/pkg/golinters) are using the golang.org/x/tools/go/analysis package, which is what nogo expects. E.g. this is how one of the linters is constructed https://github.com/tdakkota/asciicheck/blob/master/asciicheck.go. So to plug it into nogo one would need to create adapter packages (one per linter) with the desired linters exposed as package-level variables so that nogo can use them. This seems straightforward.

I personally use golant-ci-lint at the moment because it's more convenient to configure linters to ignore certain lines of code using a comment. I think such granularity is not available via nogo, unless I'm just not seeing it in the docs.

Another issue with nogo is that it analyzes all Go files in the build. I don't want it to analyze my dependencies, for example. This is a waste of CPU as I cannot do much about any found issues anyway. It's good to run it once/periodically to see the biggest problems in third-party libraries, but not all the time.

FYI @jayconrod.

from bazel-tools.

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.