Skip to content

Commit

Permalink
chore: upgrade rules_lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Oct 10, 2024
1 parent c1e2d84 commit 3076907
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use_repo(bazel_lib_toolchains, "bsd_tar_toolchains")

####### Dev dependencies ########

bazel_dep(name = "aspect_rules_lint", version = "0.12.0", dev_dependency = True)
bazel_dep(name = "aspect_rules_lint", version = "1.0.2", dev_dependency = True)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.39.1", dev_dependency = True, repo_name = "bazel_gazelle")
Expand Down
14 changes: 12 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,20 @@ buildifier_prebuilt_register_toolchains()
# rules_lint
load(
"@aspect_rules_lint//format:repositories.bzl",
"fetch_shfmt",
"rules_lint_dependencies",
)

fetch_shfmt()
rules_lint_dependencies()

load("@rules_multitool//multitool:multitool.bzl", "multitool")

multitool(
name = "multitool",
lockfiles = [
"@aspect_rules_lint//format:multitool.lock.json",
"@aspect_rules_lint//lint:multitool.lock.json",
],
)

load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")

Expand Down
8 changes: 0 additions & 8 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# rules_lint
load(
"@aspect_rules_lint//format:repositories.bzl",
"fetch_shfmt",
)

fetch_shfmt()

# dev dependency
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand Down
6 changes: 3 additions & 3 deletions js/private/dev_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def rules_js_dev_dependencies():

http_archive(
name = "aspect_rules_lint",
sha256 = "1e679b081750ca9cedad4f79e371ee5e14d9a157de8018661af9fe45879100b2",
strip_prefix = "rules_lint-0.21.0",
url = "https://github.com/aspect-build/rules_lint/releases/download/v0.21.0/rules_lint-v0.21.0.tar.gz",
sha256 = "7d5feef9ad85f0ba78cc5757a9478f8fa99c58a8cabc1660d610b291dc242e9b",
strip_prefix = "rules_lint-1.0.2",
url = "https://github.com/aspect-build/rules_lint/releases/download/v1.0.2/rules_lint-v1.0.2.tar.gz",
)

http_archive(
Expand Down
17 changes: 3 additions & 14 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,12 @@ This is in its own package because it has so many loading-time symbols,
we don't want to trigger eager fetches of these for builds that don't want to run format.
"""

load("@aspect_rules_lint//format:defs.bzl", "multi_formatter_binary")
load("@aspect_rules_lint//format:defs.bzl", "format_multirun")

package(default_visibility = ["//:__subpackages__"])

alias(
name = "shfmt",
actual = select({
"@bazel_tools//src/conditions:darwin_arm64": "@shfmt_darwin_aarch64//file:shfmt",
"@bazel_tools//src/conditions:darwin_x86_64": "@shfmt_darwin_x86_64//file:shfmt",
"@bazel_tools//src/conditions:linux_aarch64": "@shfmt_linux_aarch64//file:shfmt",
"@bazel_tools//src/conditions:linux_x86_64": "@shfmt_linux_x86_64//file:shfmt",
"//conditions:default": ":noop",
}),
)

multi_formatter_binary(
format_multirun(
name = "format",
sh = ":shfmt",
shell = "@aspect_rules_lint//format:shfmt",
starlark = "@buildifier_prebuilt//:buildifier",
)

0 comments on commit 3076907

Please sign in to comment.