Files
mongo/bazel/format/BUILD.bazel
Zack Winter e4015670c8 SERVER-101031 Use rules_lint buildifier formatter (#32590)
GitOrigin-RevId: 0126d23afc2d113b65a1c4b8a25b49ddcfc8edf2
2025-04-09 21:45:03 +00:00

48 lines
1.4 KiB
Python

load("@aspect_rules_lint//format:defs.bzl", "format_multirun", "format_test")
py_binary(
name = "rules_lint_format_wrapper",
srcs = ["rules_lint_format_wrapper.py"],
args = [
"--prettier",
"$(location //:prettier)",
"--shellscripts-linters",
"$(location //buildscripts:shellscripts_linters)",
"--rules-lint-format",
"$(location :rules_lint_format)",
"--rules-lint-format-check",
"$(location :rules_lint_format.check)",
],
data = [
":rules_lint_format",
":rules_lint_format.check",
"//:prettier",
"//buildscripts:shellscripts_linters",
"@shfmt",
],
env = {
"SHFMT_PATH": "$(execpath @shfmt//:shfmt)",
},
main = "rules_lint_format_wrapper.py",
visibility = ["//visibility:public"],
deps = [
"//buildscripts:unittest_grouper",
],
)
format_multirun(
name = "rules_lint_format",
css = "//:prettier",
graphql = "//:prettier",
html = "//:prettier",
markdown = "//:prettier",
sql = "//:prettier",
starlark = "@buildifier_prebuilt//:buildifier",
visibility = ["//visibility:public"],
# TODO(SERVER-101033): Enable clang_format once a way to only format a user's changeset is set up
# cc = "//:clang_format",
# c = "//:clang_format",
# TODO(SERVER-101034): Enable rules_lint shfmt after sh files are reformatted with .editorconfig
# shell = "@shfmt//:shfmt",
)