generated from albertocavalcante/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyzers.bzl
68 lines (58 loc) · 1.6 KB
/
analyzers.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""Nogo dependency labels for Go analyzers."""
def generate_analyzers_labels(base_path, items):
"""Generates labels by prefixing each item with a base path.
Args:
base_path: The common prefix for all labels.
items: A list of items to be converted into labels.
Returns:
A list of generated labels.
"""
labels = []
for item in items:
label = base_path + item
labels.append(label)
return labels
def go_vet_analyzers_labels():
"""Generates nogo dependency labels for Go vet analyzers.
Source:
Vet Analyzers: https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/cmd/vet/main.go;l=12-43
Returns:
labels: A list of dependency labels for Go vet analyzers.
"""
analyzers = [
"appends",
"asmdecl",
"assign",
"atomic",
"bools",
"buildtag",
"cgocall",
"composite",
"copylock",
"defers",
"directive",
"errorsas",
"framepointer",
"httpresponse",
"ifaceassert",
"loopclosure",
"lostcancel",
"nilfunc",
"printf",
"shift",
"sigchanyzer",
"slog",
"stdmethods",
"stringintconv",
"structtag",
"testinggoroutine",
"tests",
"timeformat",
"unmarshal",
"unreachable",
"unsafeptr",
"unusedresult",
]
# https://pkg.go.dev/golang.org/x/tools/go/analysis/passes
base_path = "@org_golang_x_tools//go/analysis/passes/"
return generate_analyzers_labels(base_path, analyzers)