Skip to content

Commit 6542f41

Browse files
chore: reformat Bazel files using buildifier
1 parent 4ab62a1 commit 6542f41

File tree

10 files changed

+41
-38
lines changed

10 files changed

+41
-38
lines changed

MODULE.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
module(name = "jsonnet", version = "0.0.0")
1+
module(
2+
name = "jsonnet",
3+
version = "0.0.0",
4+
)
25

36
bazel_dep(name = "googletest", version = "1.11.0", repo_name = "com_google_googletest")
47
bazel_dep(name = "rules_python", version = "0.40.0")

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ git_repository(
1111

1212
git_repository(
1313
name = "com_google_googletest",
14-
remote = "https://github.com/google/googletest.git",
1514
# If updating googletest version, also update CMakeLists.txt.in.
16-
commit = "2fe3bd994b3189899d93f1d5a881e725e046fdc2", # release: release-1.8.1
15+
commit = "2fe3bd994b3189899d93f1d5a881e725e046fdc2", # release: release-1.8.1
16+
remote = "https://github.com/google/googletest.git",
1717
shallow_since = "1535728917 -0400",
1818
)
1919

@@ -22,5 +22,5 @@ register_toolchains("//platform_defs:default_python3_toolchain")
2222

2323
# This allows building C++ against python3 headers.
2424
load("//tools/build_defs:python_repo.bzl", "python_headers")
25-
python_headers(name = "default_python3_headers")
2625

26+
python_headers(name = "default_python3_headers")

cpp/testdata/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package(default_visibility = ["//visibility:public"])
2-
31
load(
42
"@io_bazel_rules_jsonnet//jsonnet:jsonnet.bzl",
5-
"jsonnet_to_json_test",
63
"jsonnet_library",
4+
"jsonnet_to_json_test",
75
)
86

7+
package(default_visibility = ["//visibility:public"])
8+
99
jsonnet_to_json_test(
1010
name = "example_test",
1111
src = "example.jsonnet",

platform_defs/BUILD

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")
33
py_runtime(
44
name = "python3",
55
interpreter_path = "/usr/bin/python3",
6-
stub_shebang = "#!/usr/bin/env python3",
76
python_version = "PY3",
7+
stub_shebang = "#!/usr/bin/env python3",
88
)
99

1010
py_runtime_pair(
@@ -18,4 +18,3 @@ toolchain(
1818
toolchain = ":just_python3",
1919
toolchain_type = "@rules_python//python:toolchain_type",
2020
)
21-

python/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ py_test(
2323
srcs = ["_jsonnet_test.py"],
2424
data = [
2525
"testdata/basic_check.jsonnet",
26-
"testdata/binary1230123.bin",
2726
"testdata/binary123.bin",
27+
"testdata/binary1230123.bin",
2828
"testdata/trivial.jsonnet",
2929
"testdata/trivial_no_eol.jsonnet",
3030
],

stdlib/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ filegroup(
77

88
cc_library(
99
name = "std",
10-
hdrs = ["std.jsonnet.h"],
1110
srcs = [":gen-std-jsonnet-h"],
11+
hdrs = ["std.jsonnet.h"],
1212
includes = ["."],
1313
linkstatic = 1,
1414
)

third_party/json/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
licenses(["permissive"])
2+
23
package(default_visibility = ["//visibility:public"])
34

45
cc_library(
@@ -10,4 +11,3 @@ cc_library(
1011
],
1112
includes = ["."],
1213
)
13-

third_party/md5/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
licenses(["permissive"])
2+
23
package(default_visibility = ["//visibility:public"])
34

45
cc_library(
@@ -9,7 +10,6 @@ cc_library(
910
hdrs = [
1011
"md5.h",
1112
],
12-
linkopts = ["-lm"],
1313
includes = ["."],
14+
linkopts = ["-lm"],
1415
)
15-

tools/build_defs/extensions.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ load(":python_repo.bzl", "python_headers")
33

44
def _impl(repository_ctx):
55
git_repository(
6-
name = "io_bazel_rules_jsonnet",
7-
commit = "ad2b4204157ddcf7919e8bd210f607f8a801aa7f",
8-
remote = "https://github.com/bazelbuild/rules_jsonnet.git",
9-
shallow_since = "1556260764 +0200",
6+
name = "io_bazel_rules_jsonnet",
7+
commit = "ad2b4204157ddcf7919e8bd210f607f8a801aa7f",
8+
remote = "https://github.com/bazelbuild/rules_jsonnet.git",
9+
shallow_since = "1556260764 +0200",
1010
)
1111

1212
python_headers(name = "default_python3_headers")

tools/build_defs/python_repo.bzl

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ cc_library(
1414
"""
1515

1616
def _impl(repository_ctx):
17-
rctx = repository_ctx
18-
if "/" in rctx.attr.path or "\\" in rctx.attr.path:
19-
# Canonicalize the path
20-
realpath = rctx.path(rctx.attr.path)
21-
else:
22-
# Find it in $PATH
23-
realpath = rctx.which(rctx.attr.path)
24-
rctx.symlink(realpath, "bin/python")
25-
include_path = rctx.execute([
26-
realpath, "-c", "import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())",
27-
])
28-
if include_path.return_code != 0:
29-
fail("Failed to locate Python headers:\n" + include_path.stderr)
30-
rctx.symlink(include_path.stdout.strip(), "include")
31-
rctx.file(
32-
"WORKSPACE",
33-
'workspace(name = "{}")\n'.format(rctx.name),
34-
)
35-
rctx.file("BUILD", build_file_contents)
36-
17+
rctx = repository_ctx
18+
if "/" in rctx.attr.path or "\\" in rctx.attr.path:
19+
# Canonicalize the path
20+
realpath = rctx.path(rctx.attr.path)
21+
else:
22+
# Find it in $PATH
23+
realpath = rctx.which(rctx.attr.path)
24+
rctx.symlink(realpath, "bin/python")
25+
include_path = rctx.execute([
26+
realpath,
27+
"-c",
28+
"import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())",
29+
])
30+
if include_path.return_code != 0:
31+
fail("Failed to locate Python headers:\n" + include_path.stderr)
32+
rctx.symlink(include_path.stdout.strip(), "include")
33+
rctx.file(
34+
"WORKSPACE",
35+
'workspace(name = "{}")\n'.format(rctx.name),
36+
)
37+
rctx.file("BUILD", build_file_contents)
3738

3839
python_headers = repository_rule(
3940
implementation = _impl,

0 commit comments

Comments
 (0)