Skip to content

Commit bc0e3a3

Browse files
committed
fix: formatting
1 parent 4523048 commit bc0e3a3

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

bzlformat/private/bzlformat_lint_test.bzl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Definition for bzlformat_lint_test rule."""
22

3-
load("@aspect_bazel_lib//lib:windows_utils.bzl", "create_windows_native_launcher_script")
3+
load(
4+
"@aspect_bazel_lib//lib:windows_utils.bzl",
5+
"create_windows_native_launcher_script",
6+
)
47
load("@bazel_skylib//lib:shell.bzl", "shell")
58
load("//shlib/rules:execute_binary.bzl", "execute_binary_utils")
69

@@ -11,7 +14,9 @@ def _bzlformat_lint_test_impl(ctx):
1114
# Generate the lint tests
1215
lint_tests = []
1316
for src in ctx.files.srcs:
14-
exec_binary_out = ctx.actions.declare_file(ctx.label.name + "_" + src.basename + ".sh")
17+
exec_binary_out = ctx.actions.declare_file(
18+
ctx.label.name + "_" + src.basename + ".sh",
19+
)
1520
lint_tests.append(exec_binary_out)
1621
arguments = common_arguments + [src.short_path]
1722
execute_binary_utils.write_execute_binary_script(
@@ -46,22 +51,30 @@ for lint_test in "${lint_tests[@]}"; do
4651
exit_code=0
4752
"${lint_test}" || exit_code=$?
4853
if [[ ${exit_code} != 0 ]]; then
49-
failure_count=$(( ${failure_count} + 1 ))
54+
failure_count=$(( ${failure_count} + 1 ))
5055
echo >&2 "${lint_test} failed with ${exit_code}."
5156
fi
5257
done
5358
54-
[[ ${failure_count} > 0 ]] && echo >&2 "${failure_count} lint tests failed." && exit 1
59+
[[ ${failure_count} > 0 ]] && echo >&2 "${failure_count} lint tests failed." \
60+
&& exit 1
5561
echo "All tests succeeded!"
5662
""",
5763
)
5864

59-
is_windows = ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo])
60-
launcher = create_windows_native_launcher_script(ctx, bash_launcher) if is_windows else bash_launcher
65+
is_windows = ctx.target_platform_has_constraint(
66+
ctx.attr._windows_constraint[platform_common.ConstraintValueInfo],
67+
)
68+
if is_windows:
69+
launcher = create_windows_native_launcher_script(ctx, bash_launcher)
70+
else:
71+
launcher = bash_launcher
6172
extra_runfiles = [bash_launcher] if is_windows else []
6273

6374
# Gather the runfiles
64-
runfiles = ctx.runfiles(files = ctx.files.srcs + lint_tests + extra_runfiles)
75+
runfiles = ctx.runfiles(
76+
files = ctx.files.srcs + lint_tests + extra_runfiles,
77+
)
6578
runfiles = execute_binary_utils.collect_runfiles(
6679
runfiles,
6780
[ctx.attr._buildifier],

updatesrc/private/updatesrc_diff_and_update.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def updatesrc_diff_and_update(
6363
src = srcs[idx]
6464
out = outs[idx]
6565
src_name = src.replace("/", "_")
66+
6667
if failure_message == None:
6768
# create a helpful message if none has been given
6869
msg = "Run 'bazel run {}' to update {}".format(name, src)

0 commit comments

Comments
 (0)