From 56ec790c9b881c82e84904705786a9b2b994cb0e Mon Sep 17 00:00:00 2001 From: David Sanderson <32687193+dws-uber@users.noreply.github.com> Date: Fri, 25 Sep 2020 16:32:06 -0400 Subject: [PATCH] Address latent buildifier issues. (#278) In https://buildkite.com/bazel/bazel-skylib/builds/1240#annotation-buildifier I noticed buildifier issues unrelated to my PR. This PR attempts to address these latent buildifier issues. --- lib/unittest.bzl | 5 ++++- tests/selects_tests.bzl | 5 ++++- tests/unittest_tests.bzl | 10 ++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/unittest.bzl b/lib/unittest.bzl index 0cdbd94..5b70df5 100644 --- a/lib/unittest.bzl +++ b/lib/unittest.bzl @@ -126,7 +126,10 @@ def _make(impl, attrs = {}): toolchains = [TOOLCHAIN_TYPE], ) -_ActionInfo = provider(fields = ["actions", "bin_path"]) +_ActionInfo = provider( + doc = "Information relating to the target under test.", + fields = ["actions", "bin_path"], +) def _action_retrieving_aspect_impl(target, ctx): return [ diff --git a/tests/selects_tests.bzl b/tests/selects_tests.bzl index 28f3ac4..7a980e6 100644 --- a/tests/selects_tests.bzl +++ b/tests/selects_tests.bzl @@ -129,7 +129,10 @@ def _set_conditions(condition_list): ans["//command_line_option:features"] = ["notmyfeature"] return ans -_BooleanInfo = provider() +_BooleanInfo = provider( + doc = "value for boolean tests", + fields = ["value"], +) def _boolean_attr_impl(ctx): return [_BooleanInfo(value = ctx.attr.myboolean)] diff --git a/tests/unittest_tests.bzl b/tests/unittest_tests.bzl index 3d5a198..0b992f9 100644 --- a/tests/unittest_tests.bzl +++ b/tests/unittest_tests.bzl @@ -54,7 +54,10 @@ def _change_setting_test(ctx): return analysistest.end(env) -_ChangeSettingInfo = provider() +_ChangeSettingInfo = provider( + doc = "min_os_version for change_setting_test", + fields = ["min_os_version"], +) def _change_setting_fake_rule(ctx): return [_ChangeSettingInfo(min_os_version = ctx.fragments.cpp.minimum_os_version())] @@ -180,7 +183,10 @@ inspect_actions_test = analysistest.make( ######################################## ####### inspect_output_dirs_test ####### ######################################## -_OutputDirInfo = provider(fields = ["bin_path"]) +_OutputDirInfo = provider( + doc = "bin_path for inspect_output_dirs_test", + fields = ["bin_path"], +) def _inspect_output_dirs_test(ctx): """Test verifying output directories used by a test."""