Skip to content

Commit 6a6fff0

Browse files
committed
rules_score: Forward common attributes for depenable_element
This way, we avoid repeating common bazel attributes, which is also one of the best practices.
1 parent 0a1baf6 commit 6a6fff0

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

bazel/rules/rules_score/private/dependable_element.bzl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ def dependable_element(
11651165
maturity = "release",
11661166
sphinx = Label("//bazel/rules/rules_score:score_build"),
11671167
testonly = True,
1168-
visibility = None):
1168+
**kwargs):
11691169
"""Define a dependable element (Safety Element out of Context - SEooC) following S-CORE process guidelines.
11701170
11711171
This macro creates a complete dependable element with integrated documentation
@@ -1200,7 +1200,6 @@ def dependable_element(
12001200
Cross-references will work automatically.
12011201
sphinx: Label to sphinx build binary. Default: //bazel/rules/rules_score:score_build
12021202
testonly: If True, only testonly targets can depend on this target.
1203-
visibility: Bazel visibility specification for the dependable element target.
12041203
12051204
Generated Targets:
12061205
<name>_index: Internal rule that generates index.rst and copies artifacts
@@ -1231,7 +1230,7 @@ def dependable_element(
12311230
integrity_level = integrity_level,
12321231
maturity = maturity,
12331232
testonly = testonly,
1234-
visibility = visibility,
1233+
**kwargs
12351234
)
12361235

12371236
# Step 2: Create sphinx_module using generated index and artifacts.
@@ -1244,7 +1243,7 @@ def dependable_element(
12441243
deps = [d + "_doc" for d in deps],
12451244
sphinx = sphinx,
12461245
testonly = testonly,
1247-
visibility = visibility,
1246+
**kwargs
12481247
)
12491248

12501249
# Step 3: Create the main <name> target:
@@ -1255,5 +1254,5 @@ def dependable_element(
12551254
name = name,
12561255
index_dep = ":" + name + "_index",
12571256
sphinx_module_dep = ":" + name + "_doc",
1258-
visibility = visibility,
1257+
**kwargs
12591258
)

bazel/rules/rules_score/private/sphinx_module.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def sphinx_module(
294294
extra_opts = [],
295295
extra_opts_targets = [],
296296
testonly = False,
297-
visibility = ["//visibility:public"]):
297+
**kwargs):
298298
"""Build a Sphinx module with transitive HTML dependencies.
299299
This rule builds documentation modules into complete HTML sites with
300300
transitive dependency collection. All dependencies are automatically
@@ -325,7 +325,7 @@ def sphinx_module(
325325
index = index,
326326
deps = [d + "_needs" for d in deps],
327327
testonly = testonly,
328-
visibility = visibility,
328+
**kwargs
329329
)
330330
_score_html(
331331
name = name,
@@ -337,5 +337,5 @@ def sphinx_module(
337337
extra_opts = extra_opts,
338338
extra_opts_targets = extra_opts_targets,
339339
testonly = testonly,
340-
visibility = visibility,
340+
**kwargs
341341
)

0 commit comments

Comments
 (0)