blob: 1575183b300325b93f30b2f6fa6509ff2c01a438 [file] [log] [blame]
Leopold Schabel5c80aca2019-10-22 15:48:58 +02001load("@bazel_gazelle//:def.bzl", "gazelle")
Serge Bazanskif369cfa2020-05-22 18:36:42 +02002load("//build/fietsje:def.bzl", "fietsje")
Leopold Schabeleff72172020-01-04 15:07:52 +01003load("@io_bazel_rules_go//go:def.bzl", "go_path", "nogo")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02004
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02005# gazelle:prefix git.monogon.dev/source/nexantic.git
Lorenz Brun04904962019-11-11 15:21:14 +01006# gazelle:exclude core/cmd/kube-controlplane
Leopold Schabel5c80aca2019-10-22 15:48:58 +02007gazelle(name = "gazelle")
Leopold Schabeld868d692019-11-17 17:28:29 +01008
Serge Bazanskif369cfa2020-05-22 18:36:42 +02009fietsje(name = "fietsje")
10
Leopold Schabeld868d692019-11-17 17:28:29 +010011# Shortcut for the Go SDK
12alias(
13 name = "go",
14 actual = "@go_sdk//:bin/go",
Leopold Schabela4516f92019-12-04 20:27:05 +000015 visibility = ["//visibility:public"],
16)
17
Leopold Schabel60a85b62019-11-17 19:12:41 +010018# nogo linters
19nogo(
20 name = "nogo_vet",
21 config = "nogo_config.json",
22 visibility = ["//visibility:public"],
23 # These deps enable the analyses equivalent to running `go vet`.
24 # Passing vet = True enables only a tiny subset of these (the ones
25 # that are always correct).
26 #
27 # You can see the what `go vet` does by running `go doc cmd/vet`.
28 deps = [
29 "@org_golang_x_tools//go/analysis/passes/asmdecl:go_tool_library",
30 "@org_golang_x_tools//go/analysis/passes/assign:go_tool_library",
31 "@org_golang_x_tools//go/analysis/passes/atomic:go_tool_library",
32 "@org_golang_x_tools//go/analysis/passes/bools:go_tool_library",
33 "@org_golang_x_tools//go/analysis/passes/buildtag:go_tool_library",
Hendrik Hofstadt4ff52bd2020-01-12 15:21:49 +010034 # Disable cgocall because it fails processing com_github_mattn_go_sqlite3 before exclusions are applied
35 #"@org_golang_x_tools//go/analysis/passes/cgocall:go_tool_library",
Leopold Schabel60a85b62019-11-17 19:12:41 +010036 "@org_golang_x_tools//go/analysis/passes/composite:go_tool_library",
37 "@org_golang_x_tools//go/analysis/passes/copylock:go_tool_library",
38 "@org_golang_x_tools//go/analysis/passes/httpresponse:go_tool_library",
39 "@org_golang_x_tools//go/analysis/passes/loopclosure:go_tool_library",
40 "@org_golang_x_tools//go/analysis/passes/lostcancel:go_tool_library",
41 "@org_golang_x_tools//go/analysis/passes/nilfunc:go_tool_library",
42 "@org_golang_x_tools//go/analysis/passes/printf:go_tool_library",
43 "@org_golang_x_tools//go/analysis/passes/shift:go_tool_library",
44 "@org_golang_x_tools//go/analysis/passes/stdmethods:go_tool_library",
45 "@org_golang_x_tools//go/analysis/passes/structtag:go_tool_library",
46 "@org_golang_x_tools//go/analysis/passes/tests:go_tool_library",
47 "@org_golang_x_tools//go/analysis/passes/unmarshal:go_tool_library",
48 "@org_golang_x_tools//go/analysis/passes/unreachable:go_tool_library",
49 "@org_golang_x_tools//go/analysis/passes/unsafeptr:go_tool_library",
50 "@org_golang_x_tools//go/analysis/passes/unusedresult:go_tool_library",
51 ],
52)
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010053
54load("@rules_python//python:defs.bzl", "py_runtime_pair")
55
56# Python toolchains - just use the host python for now.
57# TODO(T649): move to external (nix?) interpreters.
58py_runtime(
59 name = "host_python3",
60 interpreter_path = "/usr/bin/python3",
61 python_version = "PY3",
62)
63
64py_runtime(
65 name = "host_python2",
66 interpreter_path = "/usr/bin/python2",
67 python_version = "PY2",
68)
69
70py_runtime_pair(
71 name = "host_python_pair",
72 py2_runtime = ":host_python2",
73 py3_runtime = ":host_python3",
74)
75
76toolchain(
77 name = "host_python",
78 toolchain = ":host_python_pair",
79 toolchain_type = "@rules_python//python:toolchain_type",
80)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010081
82# Shortcut for kubectl when running through bazel run
83# (don't depend on this, it might turn into an env-based PATH shortcut, use
Serge Bazanskibb7db922020-04-30 12:43:10 +020084# @io_k8s_kubernetes//cmd/kubectl instead)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010085alias(
86 name = "kubectl",
Serge Bazanskibb7db922020-04-30 12:43:10 +020087 actual = "@io_k8s_kubernetes//cmd/kubectl:kubectl",
Serge Bazanski2fb13a82020-02-11 12:41:37 +010088)