fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreAdded rustfmt config for running rustfmt in CI (#747)52c87aad

0.10.0
1.0 KiB58 linesraw
1load("@rules_rust//rust:defs.bzl", "rust_binary", "rustfmt_test")
2
3exports_files([
4    "test_rustfmt.toml",
5])
6
7rust_binary(
8    name = "formatted_2018",
9    srcs = ["srcs/2018/formatted.rs"],
10    edition = "2018",
11)
12
13rustfmt_test(
14    name = "test_formatted_2018",
15    targets = [":formatted_2018"],
16)
17
18rust_binary(
19    name = "unformatted_2018",
20    srcs = ["srcs/2018/unformatted.rs"],
21    edition = "2018",
22    tags = ["norustfmt"],
23)
24
25rustfmt_test(
26    name = "test_unformatted_2018",
27    tags = ["manual"],
28    targets = [":unformatted_2018"],
29)
30
31rust_binary(
32    name = "formatted_2015",
33    srcs = ["srcs/2015/formatted.rs"],
34    edition = "2015",
35)
36
37rustfmt_test(
38    name = "test_formatted_2015",
39    targets = [":formatted_2015"],
40)
41
42rust_binary(
43    name = "unformatted_2015",
44    srcs = ["srcs/2015/unformatted.rs"],
45    edition = "2015",
46    tags = ["norustfmt"],
47)
48
49rustfmt_test(
50    name = "test_unformatted_2015",
51    tags = ["manual"],
52    targets = [":unformatted_2015"],
53)
54
55sh_binary(
56    name = "test_runner",
57    srcs = ["rustfmt_failure_test.sh"],
58)