Open michelgb opened 1 year ago
Although I agree this could be better handled, the nogo
doc section at "running vet" states:
Setting
vet = True
is equivalent to adding theatomic
,bools
,buildtag
,nilfunc
, andprintf
analyzers from@org_golang_x_tools//go/analysis/passes
to thedeps
list of yournogo
rule.
And TOOLS_NOGO
is a list of all the analysis/passes as per https://github.com/bazelbuild/rules_go/blob/master/go/def.bzl#L77-L120, so this should be expected to happen.
The way I take this, vet
is a sugar syntax to replicate the behavior of go vet ./...
but if you want to add other analyzers, you may individually pick those in deps
.
nogo(
name = "nogo",
config = "nogo.json", # needed a config to exclude a few files
vet = True, # enabled vet
visibility = ["//visibility:public"],
deps = [
"@org_golang_x_tools//go/analysis/passes/slog",
"@org_golang_x_tools//go/analysis/passes/unreachable",
]
)
If you want to run all, you can simply remove the vet
.
What version of rules_go are you using?
v0.39.1
What version of gazelle are you using?
v0.30.0
What version of Bazel are you using?
v6.2.1
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
x86_64
Any other potentially useful information about your toolchain?
Just building go code.
What did you do?
What did you expect to see?
I would expect Bazel to compile normally.
What did you see instead?
The build fails due to duplicated dependencies. Perhaps the rule can do a better job by deduplicating dependencies.