Comments (4)
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.
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.
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.
cc @whizard
from bazel-tools.
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)
- Failed to send SIGTERM, sending SIGKILL HOT 1
- Golangci-lint on generated code HOT 2
- Do not hard code version HOT 2
- Action Required: Fix Renovate Configuration
- Silence output in serial mode HOT 2
- Symlink cycle HOT 1
- Multirun cannot find bash runfiles HOT 7
- golangci-lint rule should cache output results HOT 2
- golangcilint unable to load external deps HOT 1
- Run golangci-lint in a subfolder HOT 2
- Pick up default config file for golangci.yml HOT 1
- [multirun] ctrl-c will leave the started processes running HOT 3
- Fix $@ expansion
- [multirun] shorter labels HOT 3
- Support data attribute in multirun command HOT 2
- Support make variable substitution in command.args HOT 6
- Buildkite builds cannot report status
- use of multirun with ibazel HOT 2
- golangcilint: errors on generated file imports HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel-tools.