diff --git a/docs/jq.md b/docs/jq.md index 63344d0cf..d16312220 100755 --- a/docs/jq.md +++ b/docs/jq.md @@ -7,7 +7,7 @@ Public API for jq ## jq
-jq(name, srcs, filter, args, out) +jq(name, srcs, filter, args, out, kwargs)Invoke jq with a filter on a set of json input files. @@ -63,5 +63,6 @@ jq( | filter | mandatory jq filter specification (https://stedolan.github.io/jq/manual/#Basicfilters) | none | | args | additional args to pass to jq |
[]
|
| out | Name of the output json file; defaults to the rule name plus ".json" | None
|
+| kwargs | other common named parameters such as tags
or visibility
| none |
diff --git a/lib/jq.bzl b/lib/jq.bzl
index 3225c1142..4cace1693 100644
--- a/lib/jq.bzl
+++ b/lib/jq.bzl
@@ -8,7 +8,7 @@ _jq_rule = rule(
toolchains = ["@aspect_bazel_lib//lib:jq_toolchain_type"],
)
-def jq(name, srcs, filter, args = [], out = None):
+def jq(name, srcs, filter, args = [], out = None, **kwargs):
"""Invoke jq with a filter on a set of json input files.
For jq documentation, see https://stedolan.github.io/jq/.
@@ -57,6 +57,7 @@ def jq(name, srcs, filter, args = [], out = None):
filter: mandatory jq filter specification (https://stedolan.github.io/jq/manual/#Basicfilters)
args: additional args to pass to jq
out: Name of the output json file; defaults to the rule name plus ".json"
+ **kwargs: other common named parameters such as `tags` or `visibility`
"""
if not out:
out = name + ".json"
@@ -67,4 +68,5 @@ def jq(name, srcs, filter, args = [], out = None):
filter = filter,
args = args,
out = out,
+ **kwargs
)