forked from aspect-build/rules_lint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
62 lines (57 loc) · 1.7 KB
/
Copy pathBUILD.bazel
File metadata and controls
62 lines (57 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
load("@bazel_skylib//lib:sets.bzl", "sets")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("//format:defs.bzl", "format_multirun")
load("//format/private:formatter_binary.bzl", "TOOLS")
sh_test(
name = "ls-files_test",
srcs = ["ls-files_test.sh"],
data = ["//format/private:format"],
)
UNIQUE_TOOLS = sets.to_list(sets.make(TOOLS.values()))
# Avoid depending on a bunch of actual tools in the root module.
# That's the job of the example/ submodule.
# Instead, just provide "recording mock" for each formatter we support.
[
write_file(
name = "mock_{}_sh".format(t),
out = "mock_{}.sh".format(t),
content = [
"#!/usr/bin/env bash",
"echo + {} $*".format(t),
],
)
for t in UNIQUE_TOOLS
]
[
sh_binary(
name = "mock_" + t,
srcs = ["mock_{}.sh".format(t)],
)
for t in UNIQUE_TOOLS
]
format_multirun(
name = "format",
cc = ":mock_clang-format.sh",
css = ":mock_prettier.sh",
cuda = ":mock_clang-format.sh",
go = ":mock_gofmt.sh",
graphql = ":mock_prettier.sh",
html = ":mock_prettier.sh",
java = ":mock_java-format.sh",
javascript = ":mock_prettier.sh",
jsonnet = ":mock_jsonnetfmt.sh",
kotlin = ":mock_ktfmt.sh",
markdown = ":mock_prettier.sh",
protocol_buffer = ":mock_buf.sh",
python = ":mock_ruff.sh",
rust = ":mock_rustfmt.sh",
scala = ":mock_scalafmt.sh",
shell = ":mock_shfmt.sh",
sql = ":mock_prettier.sh",
starlark = ":mock_buildifier.sh",
swift = ":mock_swiftformat.sh",
# TODO: this attribute should be renamed to hcl
terraform = ":mock_terraform-fmt.sh",
xml = ":mock_prettier.sh",
yaml = ":mock_yamlfmt.sh",
)