bazel: add golangci-lint to //:check target (#1494)

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-23 12:27:09 -04:00 committed by GitHub
parent e92c08be31
commit f7713df833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 158 additions and 56 deletions

View file

@ -65,6 +65,36 @@ def sh_template(name, **kwargs):
**kwargs
)
def sh_test_template(name, **kwargs):
"""Build a sh_test from a template
Args:
name: name
**kwargs: **kwargs
"""
script_name = name + "-script"
tags = kwargs.get("tags", [])
data = kwargs.get("data", [])
data.append("//bazel/sh:base_lib")
substitutions = kwargs.pop("substitutions", [])
substitutions["@@BASE_LIB@@"] = "$(rootpath //bazel/sh:base_lib)"
template = kwargs.pop("template", [])
_sh_template(
name = script_name,
tags = tags,
data = data,
substitutions = substitutions,
template = template,
)
native.sh_test(
name = name,
srcs = [script_name],
**kwargs
)
def repo_command(name, **kwargs):
"""Build a sh_binary that executes a single command.