Skip to content

Commit

Permalink
Fix buildifier warning
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Oct 8, 2020
1 parent b7a2693 commit 9d472c1
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/rules/provider_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ load(
"unittest",
)

# A sentinel value returned by `_evaluate_field` when a `None` value is
# encountered during the evaluation of a dotted path on any component other than
# the last component. This allows the caller to distinguish between a legitimate
# `None` value being returned by the entire path vs. an unexpected `None` in an
# earlier component.
#
# A `provider` is used here because it is a simple way of getting a known unique
# object from Bazel that cannot be equal to any other object.
_EVALUATE_FIELD_FAILED = provider()
_EVALUATE_FIELD_FAILED = provider(
doc = """
A sentinel value returned by `_evaluate_field` when a `None` value is
encountered during the evaluation of a dotted path on any component other than
the last component. This allows the caller to distinguish between a legitimate
`None` value being returned by the entire path vs. an unexpected `None` in an
earlier component.
A `provider` is used here because it is a simple way of getting a known unique
object from Bazel that cannot be equal to any other object.
""",
fields = [],
)

def _evaluate_field(env, source, field):
"""Evaluates a field or field path on an object and returns its value.
Expand Down

0 comments on commit 9d472c1

Please sign in to comment.