Skip to content

Commit

Permalink
chore(buildifier): enable provider-params lint check (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle authored Oct 3, 2023
1 parent 8e17eff commit beba0f3
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ repos:
hooks:
- id: buildifier
- id: buildifier-lint
args:
- --warnings=-provider-params
2 changes: 1 addition & 1 deletion configurations/basic_build_setting/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# buildifier: disable=module-docstring
TemperatureInfo = provider(fields = ["type"])
TemperatureInfo = provider(doc = "", fields = ["type"])

temperatures = ["HOT", "LUKEWARM", "ICED"]

Expand Down
2 changes: 1 addition & 1 deletion configurations/label_typed_build_setting/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# buildifier: disable=module-docstring
ToolInfo = provider(fields = ["type"])
ToolInfo = provider(doc = "", fields = ["type"])

# buildifier: disable=print
def _toolbox_impl(ctx):
Expand Down
2 changes: 1 addition & 1 deletion configurations/multi_arch_binary/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ foo_binary = rule(
},
)

CpuInfo = provider(fields = ["value"])
CpuInfo = provider(doc = "", fields = ["value"])

def _impl(ctx):
# Get the current cpu using `ctx.var` which contains a
Expand Down
2 changes: 1 addition & 1 deletion configurations/select_on_build_setting/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# buildifier: disable=module-docstring
FruitInfo = provider(fields = ["type"])
FruitInfo = provider(doc = "", fields = ["type"])

# buildifier: disable=print
def _impl(ctx):
Expand Down
2 changes: 1 addition & 1 deletion flags-parsing-tutorial/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# buildifier: disable=module-docstring
BuildSettingInfo = provider()
BuildSettingInfo = provider(doc = "", fields = ["value"])

def _string_imp(ctx):
value = ctx.build_setting_value
Expand Down
1 change: 1 addition & 0 deletions rules/aspect/file_collector.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ For more information about aspects, see the documentation:
"""

CollectedFileInfo = provider(
doc = "",
fields = {"files": "collected files"},
)

Expand Down
2 changes: 1 addition & 1 deletion rules/depsets/foo.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# buildifier: disable=module-docstring
FooFilesInfo = provider("transitive_sources")
FooFilesInfo = provider(doc = "", fields = ["transitive_sources"])

def get_transitive_srcs(srcs, deps):
"""Obtain the source files for a target and its transitive dependencies.
Expand Down
2 changes: 1 addition & 1 deletion rules/mandatory_provider/sum.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ file. This shows how to transfer information from a dependency to its
dependents.
"""

NumberInfo = provider("number")
NumberInfo = provider(doc = "", fields = ["number"])

def _impl(ctx):
result = ctx.attr.number
Expand Down
2 changes: 1 addition & 1 deletion rules/optional_provider/sum.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ file. This shows how to transfer information from a dependency to its
dependents. Dependencies are not required to provide a number.
"""

NumberInfo = provider("number")
NumberInfo = provider(doc = "", fields = ["number"])

def _impl(ctx):
result = ctx.attr.number
Expand Down
2 changes: 1 addition & 1 deletion rules/runfiles/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ such a scenario.

# When possible, use custom providers to manage propagating information
# between dependencies and their dependers.
RuntimeRequiredFilesInfo = provider(fields = ["file", "data_files"])
RuntimeRequiredFilesInfo = provider(doc = "", fields = ["file", "data_files"])

def _library_impl(ctx):
# Expand the label in the command string to a runfiles-relative path.
Expand Down

0 comments on commit beba0f3

Please sign in to comment.