Skip to content

Commit bcaa7d1

Browse files
committed
Enforce buildifier formatting in cuttlefish/bazel/*.bzl
Bug: b/532697459
1 parent 8be30ca commit bcaa7d1

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

base/cvd/cuttlefish/bazel/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
load("//cuttlefish/bazel:rules.bzl", "cf_build_test")
16+
17+
cf_build_test(
18+
name = "cf_build_test",
19+
srcs = [
20+
"local.bzl",
21+
"rules.bzl",
22+
],
23+
)

base/cvd/cuttlefish/bazel/local.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def _common_attrs():
2828
}
2929

3030
def _local_repository_impl(repository_ctx):
31-
3231
target = repository_ctx.path(repository_ctx.attr.path)
3332
for child in target.readdir():
3433
repository_ctx.symlink(child, repository_ctx.path(child.basename))

base/cvd/cuttlefish/bazel/rules.bzl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
"""
16+
Macros wrapping executable, library, and test targets that generate linter
17+
invocation targets.
18+
"""
19+
1520
load("@aspect_rules_lint//format:defs.bzl", "format_test")
1621
load("@cc_compatibility_proxy//:proxy.bzl", "cc_binary", "cc_library", "cc_test")
1722
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
@@ -33,7 +38,7 @@ def _cf_build_test_implementation(name, srcs, **kwargs):
3338
buildifier_test(
3439
name = name + "_LINT_TEST",
3540
srcs = [":" + name + "_LINT_TEST_starlark_files"],
36-
**kwargs,
41+
**kwargs
3742
)
3843

3944
cf_build_test = macro(
@@ -42,7 +47,7 @@ cf_build_test = macro(
4247
"srcs": attr.label_list(
4348
configurable = False,
4449
default = [],
45-
)
50+
),
4651
},
4752
implementation = _cf_build_test_implementation,
4853
)
@@ -54,7 +59,7 @@ def _cf_cc_binary_implementation(name, clang_format_enabled, clang_tidy_enabled,
5459
name = name,
5560
copts = (copts or []) + COPTS,
5661
linkopts = (linkopts or []) + LINKOPTS,
57-
**kwargs,
62+
**kwargs
5863
)
5964
if clang_format_enabled:
6065
format_test(
@@ -89,7 +94,7 @@ def _cf_cc_library_implementation(name, clang_format_enabled, clang_tidy_enabled
8994
cc_library(
9095
name = name,
9196
copts = (copts or []) + COPTS,
92-
**kwargs,
97+
**kwargs
9398
)
9499
if clang_format_enabled:
95100
format_test(
@@ -127,7 +132,7 @@ def _cf_cc_test_implementation(name, clang_format_enabled, clang_tidy_enabled, c
127132
"@googletest//:gtest",
128133
"@googletest//:gtest_main",
129134
],
130-
**kwargs,
135+
**kwargs
131136
)
132137
if clang_format_enabled:
133138
format_test(
@@ -159,7 +164,7 @@ cf_cc_test = macro(
159164
def _cf_sh_binary_implementation(name, shellcheck_enabled, **kwargs):
160165
sh_binary(
161166
name = name,
162-
**kwargs,
167+
**kwargs
163168
)
164169
if shellcheck_enabled:
165170
shellcheck_test(
@@ -180,7 +185,7 @@ cf_sh_binary = macro(
180185
def _cf_sh_library_implementation(name, shellcheck_enabled, **kwargs):
181186
sh_library(
182187
name = name,
183-
**kwargs,
188+
**kwargs
184189
)
185190
if shellcheck_enabled:
186191
shellcheck_test(

0 commit comments

Comments
 (0)