aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMohsin Kaleem <mohkale@kisara.moe>2023-04-22 11:38:15 +0100
committerGitHub <noreply@github.com>2023-04-22 11:38:15 +0100
commit5cb7156ef5d5e09d1a5c9a8dd157a62566f6aece (patch)
treec7d501d0f232218a810ea14a707dbad3071fb2a6 /test
parent85a2ab7e5e6db87976a611dd70118f1e3c9ac18c (diff)
Add buildifier formatter (#171)
Diffstat (limited to 'test')
-rw-r--r--test/formatters/installers/buildifier.bash2
-rw-r--r--test/formatters/samplecode/buildifier/in.bazel4
-rw-r--r--test/formatters/samplecode/buildifier/out.bazel8
3 files changed, 14 insertions, 0 deletions
diff --git a/test/formatters/installers/buildifier.bash b/test/formatters/installers/buildifier.bash
new file mode 100644
index 0000000..b17b227
--- /dev/null
+++ b/test/formatters/installers/buildifier.bash
@@ -0,0 +1,2 @@
+version=6.0.1
+curl -L --output /usr/local/bin/buildifier "https://github.com/bazelbuild/buildtools/releases/download/$version/buildifier-linux-amd64" && chmod +x /usr/local/bin/buildifier
diff --git a/test/formatters/samplecode/buildifier/in.bazel b/test/formatters/samplecode/buildifier/in.bazel
new file mode 100644
index 0000000..f449503
--- /dev/null
+++ b/test/formatters/samplecode/buildifier/in.bazel
@@ -0,0 +1,4 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library");cc_library(
+name="hello-greet",
+srcs=["hello-greet.cc"],
+hdrs=["hello-greet.h"]);cc_binary(name="hello-world", srcs=["hello-world.cc"], deps=[":hello-greet", "//lib:hello-time"])
diff --git a/test/formatters/samplecode/buildifier/out.bazel b/test/formatters/samplecode/buildifier/out.bazel
new file mode 100644
index 0000000..ad8d7a7
--- /dev/null
+++ b/test/formatters/samplecode/buildifier/out.bazel
@@ -0,0 +1,8 @@
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+
+cc_library(
+ name = "hello-greet",
+ srcs = ["hello-greet.cc"],
+ hdrs = ["hello-greet.h"],
+)
+cc_binary(name = "hello-world", srcs = ["hello-world.cc"], deps = [":hello-greet", "//lib:hello-time"])