bazel: add shellcheck to //:check

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-16 14:24:53 +01:00
parent e72e544444
commit 0fc15b2393
12 changed files with 158 additions and 55 deletions

View file

@ -0,0 +1,8 @@
genrule(
name = "shellcheck_bin",
srcs = ["shellcheck"],
outs = ["shellcheck_bin_out"],
cmd = "cp $< $@", # Copy the binary to the output directory.
executable = True,
visibility = ["//visibility:public"],
)

View file

@ -0,0 +1,33 @@
"""CI dependencies"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def ci_deps():
_shellcheck_deps()
def _shellcheck_deps():
http_archive(
name = "com_github_koalaman_shellcheck_linux_x86_64",
urls = [
"https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.linux.x86_64.tar.xz",
],
sha256 = "700324c6dd0ebea0117591c6cc9d7350d9c7c5c287acbad7630fa17b1d4d9e2f",
strip_prefix = "shellcheck-v0.9.0",
build_file = "//bazel/toolchains:BUILD.shellcheck.bazel",
)
http_archive(
name = "com_github_koalaman_shellcheck_linux_aaarch64",
urls = [
"https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.linux.aarch64.tar.xz",
],
strip_prefix = "shellcheck-v0.9.0",
build_file = "//bazel/toolchains:BUILD.shellcheck.bazel",
)
http_archive(
name = "com_github_koalaman_shellcheck_darwin_x86_64",
urls = [
"https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.darwin.x86_64.tar.xz",
],
strip_prefix = "shellcheck-v0.9.0",
build_file = "//bazel/toolchains:BUILD.shellcheck.bazel",
)