https://pantsbuild.org/ logo
l

lively-garden-66504

04/06/2023, 9:54 PM
Hey team. Any support for running Go analyzers as part of
check
or
compile
like Bazel does via nogo?
f

fast-nail-55400

04/06/2023, 10:00 PM
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

lively-garden-66504

04/06/2023, 10:03 PM
Nice nice, just what I was hoping for. Do you know if it still supports incrementalism?
f

fast-nail-55400

04/06/2023, 10:04 PM
I am not sure I understand the question. What program supports "incrementalism"?
Do you mean Pants or golangci_lint?
l

lively-garden-66504

04/06/2023, 10:05 PM
Just the goal I guess. I recall MyPy isn't incremental
f

fast-nail-55400

04/06/2023, 10:06 PM
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

lively-garden-66504

04/06/2023, 10:48 PM
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

fast-nail-55400

04/07/2023, 7:00 AM
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.
4 Views