...

Text file src/edge-infra.dev/hack/build/rules/shellcheck/bin.bzl

Documentation: edge-infra.dev/hack/build/rules/shellcheck

     1"""Defines shellcheck external dependencies"""
     2
     3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
     4
     5SHELLCHECK_VERSIONS = {
     6    "v0.7.2": {
     7        "darwin.x86_64": "969bd7ef668e8167cfbba569fb9f4a0b2fc1c4021f87032b6a0b0e525fb77369",
     8        "linux.x86_64": "70423609f27b504d6c0c47e340f33652aea975e45f312324f2dbf91c95a3b188",
     9    },
    10}
    11
    12def shellcheck_dependencies():
    13    """Returns http_archives for shellcheck."""
    14    version = SHELLCHECK_VERSIONS.keys()[0]
    15
    16    for platform in SHELLCHECK_VERSIONS[version].keys():
    17        http_archive(
    18            name = "shellcheck_" + platform.replace(".", "_"),
    19            build_file_content = """
    20package(default_visibility = ["//visibility:public"])
    21
    22filegroup(
    23  name = "file",
    24  srcs = glob(["shellcheck-{0}/shellcheck"]),
    25  visibility = ["//visibility:public"]
    26)
    27""".format(version),
    28            sha256 = SHELLCHECK_VERSIONS[version][platform],
    29            urls = [
    30                "https://github.com/koalaman/shellcheck/releases/download/{version}/shellcheck-{version}.{platform}.tar.xz".format(
    31                    version = version,
    32                    platform = platform,
    33                ),
    34            ],
    35        )

View as plain text