Hey team. Any support for running Go analyzers as...
# general
l
Hey team. Any support for running Go analyzers as part of
check
or
compile
like Bazel does via nogo?
f
Enable the applicable backends and they will run during the
lint
goal.
👀 1
Pants supports the golangci_lint linter
pants.backend.experimental.go.lint.golangci_lint
backend
❤️ 1
if there are other linters you want in Pants, it is straightforward to add lint plugins. we would welcome contributions there.
l
Nice nice, just what I was hoping for. Do you know if it still supports incrementalism?
f
I am not sure I understand the question. What program supports "incrementalism"?
Do you mean Pants or golangci_lint?
l
Just the goal I guess. I recall MyPy isn't incremental
f
By "incremental", do you mean that the linter only flags errors in new code?
Regarding the
lint
goal, I do not believe it is incremental in that sense.
😢 1
l
Ah that's unfortunate. Yeah I was hoping it had the same incremental behavior that golangci-lint itself has
At least you can run
./pants lint --changed-since
I assume
f
Yes --changed-since should work. Also the
lint
goal will still cache prior runs and use the cached result if the underlying files did not change at all.
But I am not familiar enough with golangci_lint to know if any "incremental" behavior specific to that tool works with Pants. I suggest trying and see if it does work. If not, file an issue so at least we know there is something to fix.