Skip to content

Commit

Permalink
fix formatting problem (bazelbuild#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiuto authored Jul 12, 2019
1 parent 10851c2 commit 2b38b2f
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions rules/common_settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ https://docs.bazel.build/versions/master/skylark/config.html#user-defined-build-
BuildSettingInfo = provider(
doc = "A singleton provider that contains the raw value of a build setting",
fields = {
"value": "The value of the build setting in the current configuration. "
+ "This value may come from the command line or an upstream transition, "
+ "or else it will be the build setting's default."
}
"value": "The value of the build setting in the current configuration. " +
"This value may come from the command line or an upstream transition, " +
"or else it will be the build setting's default.",
},
)

def _impl(ctx):
Expand Down Expand Up @@ -75,24 +75,26 @@ def _string_impl(ctx):
if len(allowed_values) == 0 or value in ctx.attr.values:
return BuildSettingInfo(value = value)
else:
fail("Error setting "+ str(ctx.label) + ": invalid value '" + value + "'. Allowed values are " + str(allowed_values))
fail("Error setting " + str(ctx.label) + ": invalid value '" + value + "'. Allowed values are " + str(allowed_values))

string_flag = rule(
implementation = _string_impl,
build_setting = config.string(flag = True),
attrs = {
"values" : attr.string_list(
doc = "The list of allowed values for this setting. An error is raised if any other value is given."
)},
"values": attr.string_list(
doc = "The list of allowed values for this setting. An error is raised if any other value is given.",
),
},
doc = "A string-typed build setting that can be set on the command line",
)

string_setting = rule(
implementation = _string_impl,
build_setting = config.string(),
attrs = {
"values" : attr.string_list(
doc = "The list of allowed values for this setting. An error is raised if any other value is given."
)},
"values": attr.string_list(
doc = "The list of allowed values for this setting. An error is raised if any other value is given.",
),
},
doc = "A string-typed build setting that cannot be set on the command line",
)

0 comments on commit 2b38b2f

Please sign in to comment.