Skip to content

Commit 18eaed1

Browse files
Move Shellcheck binary source to the Shellcheck author's repo (#43)
The repository vscode-shellcheck is archived as of august 4th, possibly ceasing updates on shellcheck binaries. Fixes #42
1 parent dc80b00 commit 18eaed1

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

deps.bzl

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,53 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
77
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
88

99
def _urls(arch, version):
10-
url = "https://github.com/vscode-shellcheck/shellcheck-binaries/releases/download/{version}/shellcheck-{version}.{arch}.tar.gz".format(
10+
archive_template_name = {
11+
"darwin_aarch64": "shellcheck-{version}.{arch}.tar.xz",
12+
"darwin_x86_64": "shellcheck-{version}.{arch}.tar.xz",
13+
"linux_aarch64": "shellcheck-{version}.{arch}.tar.xz",
14+
"linux_armv6hf": "shellcheck-{version}.{arch}.tar.xz",
15+
"linux_x86_64": "shellcheck-{version}.{arch}.tar.xz",
16+
"windows_x86_64": "shellcheck-{version}.zip",
17+
}
18+
url = "https://github.com/koalaman/shellcheck/releases/download/{version}/{archive}".format(
1119
version = version,
12-
arch = arch.replace("_", ".", 1),
20+
archive = archive_template_name[arch].format(
21+
version = version,
22+
arch = arch.replace("_", ".", 1),
23+
)
1324
)
1425

1526
return [
16-
url.replace("https://", "https://mirror.bazel.build/"),
1727
url,
1828
]
1929

2030
def shellcheck_dependencies():
21-
version = "v0.9.0"
31+
version = "v0.11.0"
2232
sha256 = {
23-
"darwin_aarch64": "a75b912015aaa5b2a48698b63f3619783d90abda4d32a31362209315e6c1cdf6",
24-
"darwin_x86_64": "d1244da2aa5d0c2874f3a4a680c6ac79a488ff6dbf9928e12dc80ff3fdc294db",
25-
"linux_aarch64": "b5633bd195cfe61a310bd8dcff2514855afefea908942a0fd4d01fa6451cb4e6",
26-
"linux_armv6hf": "4791d36d84a626c4366746d14ad68daf2c07f502da09319c45fa6c5c0a847aa9",
27-
"linux_x86_64": "0ab5711861e6fcafad5aa21587ee75bbd2b16505d56f41c9ba1191a83d314074",
28-
"windows_x86_64": "a0f021057b6d6a69a22f6b0db0187bcaca3f5195385e92a7555ad63a6e39ee15",
33+
"darwin_aarch64": "56affdd8de5527894dca6dc3d7e0a99a873b0f004d7aabc30ae407d3f48b0a79",
34+
"darwin_x86_64": "3c89db4edcab7cf1c27bff178882e0f6f27f7afdf54e859fa041fca10febe4c6",
35+
"linux_aarch64": "12b331c1d2db6b9eb13cfca64306b1b157a86eb69db83023e261eaa7e7c14588",
36+
"linux_armv6hf": "8afc50b302d5feeac9381ea114d563f0150d061520042b254d6eb715797c8223",
37+
"linux_x86_64": "8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198",
2938
}
3039

3140
for arch, sha256 in sha256.items():
3241
maybe(
3342
http_archive,
3443
name = "shellcheck_{arch}".format(arch = arch),
44+
strip_prefix = "shellcheck-{version}".format(version = version),
3545
build_file_content = """exports_files(["shellcheck"])
3646
""",
3747
sha256 = sha256,
3848
urls = _urls(arch = arch, version = version),
3949
)
50+
51+
# Special case, as it is a zip archive with no prefix to strip.
52+
maybe(
53+
http_archive,
54+
name = "shellcheck_windows_x86_64",
55+
build_file_content = """exports_files(["shellcheck"])
56+
""",
57+
sha256 = "8a4e35ab0b331c85d73567b12f2a444df187f483e5079ceffa6bda1faa2e740e",
58+
urls = _urls(arch = "windows_x86_64", version = version),
59+
)

0 commit comments

Comments
 (0)