Skip to content

Commit b58cfa3

Browse files
authored
Merge pull request #1597 from tweag/ip/buildifier-test-target
Add buildifier_test target
2 parents 0547755 + f434ca4 commit b58cfa3

File tree

18 files changed

+163
-4
lines changed

18 files changed

+163
-4
lines changed

BUILD.bazel

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
1+
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
22

33
exports_files(["start"])
44

@@ -48,3 +48,24 @@ buildifier(
4848
mode = "fix",
4949
verbose = True,
5050
)
51+
52+
buildifier_test(
53+
name = "buildifier_test",
54+
srcs = [
55+
"BUILD.bazel",
56+
"WORKSPACE",
57+
"constants.bzl",
58+
"//debug/linking_utils:all_files",
59+
"//docs:all_files",
60+
"//haskell:all_files",
61+
"//nixpkgs:all_files",
62+
"//rule_info:all_files",
63+
"//tests:all_files",
64+
"//tools:all_files",
65+
"@examples-arm//:all_files",
66+
"@examples//:all_files",
67+
"@tutorial//:all_files",
68+
],
69+
mode = "diff",
70+
tags = ["dont_test_on_windows"],
71+
)

WORKSPACE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,3 +583,18 @@ bind(
583583
load("//tools:repositories.bzl", "rules_haskell_worker_dependencies")
584584

585585
rules_haskell_worker_dependencies()
586+
587+
local_repository(
588+
name = "tutorial",
589+
path = "tutorial",
590+
)
591+
592+
local_repository(
593+
name = "examples",
594+
path = "examples",
595+
)
596+
597+
local_repository(
598+
name = "examples-arm",
599+
path = "examples/arm",
600+
)

examples/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
filegroup(
2+
name = "all_files",
3+
testonly = True,
4+
srcs = [
5+
"BUILD.bazel",
6+
"WORKSPACE",
7+
"//cat_hs:all_files",
8+
"//primitive:all_files",
9+
"//rts:all_files",
10+
"//transformers:all_files",
11+
"//vector:all_files",
12+
],
13+
visibility = ["//visibility:public"],
14+
)

examples/WORKSPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ local_repository(
55
path = "..",
66
)
77

8+
local_repository(
9+
name = "arm",
10+
path = "arm",
11+
)
12+
813
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
914
load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies")
1015

examples/arm/BUILD.bazel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,20 @@ platform(
4747
"@platforms//cpu:aarch64",
4848
],
4949
)
50+
51+
filegroup(
52+
name = "all_files",
53+
testonly = True,
54+
srcs = [
55+
"BUILD.bazel",
56+
"BUILD.zlib.bazel",
57+
"Example.hs",
58+
"Example2.hs",
59+
"LibExample.hs",
60+
"WORKSPACE",
61+
"arm-cross.nix",
62+
"qemu-shell.nix",
63+
"shell.nix",
64+
],
65+
visibility = ["//visibility:public"],
66+
)

examples/cat_hs/BUILD.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ haskell_doc(
1010
"//cat_hs/lib/cat",
1111
],
1212
)
13+
14+
filegroup(
15+
name = "all_files",
16+
testonly = True,
17+
srcs = glob(["**"]) + [
18+
"//cat_hs/exec/cat_hs:all_files",
19+
"//cat_hs/lib/args:all_files",
20+
"//cat_hs/lib/cat:all_files",
21+
],
22+
visibility = ["//visibility:public"],
23+
)

examples/cat_hs/exec/cat_hs/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ haskell_binary(
1212
"@stackage//:base",
1313
],
1414
)
15+
16+
filegroup(
17+
name = "all_files",
18+
testonly = True,
19+
srcs = glob(["**"]),
20+
visibility = ["//visibility:public"],
21+
)

examples/cat_hs/lib/args/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ haskell_test(
2424
"@stackage//:optparse-applicative",
2525
],
2626
)
27+
28+
filegroup(
29+
name = "all_files",
30+
testonly = True,
31+
srcs = glob(["**"]),
32+
visibility = ["//visibility:public"],
33+
)

examples/cat_hs/lib/cat/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ haskell_test(
3131
"@stackage//:text",
3232
],
3333
)
34+
35+
filegroup(
36+
name = "all_files",
37+
testonly = True,
38+
srcs = glob(["**"]),
39+
visibility = ["//visibility:public"],
40+
)

examples/primitive/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ haskell_library(
3333
"//transformers",
3434
],
3535
)
36+
37+
filegroup(
38+
name = "all_files",
39+
testonly = True,
40+
srcs = glob(["**"]),
41+
visibility = ["//visibility:public"],
42+
)

0 commit comments

Comments
 (0)