Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bazel/rules/rules_score/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ py_binary(
requirement("rst2pdf"),
requirement("sphinxcontrib-umlet"),
requirement("svglib"),
requirement("sphinxcontrib-mermaid"),
requirement("sphinxcontrib-plantuml"),
],
)
Expand Down Expand Up @@ -199,3 +200,4 @@ string_flag(
],
visibility = ["//visibility:public"],
)

4 changes: 4 additions & 0 deletions bazel/rules/rules_score/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ architectural_design(
Diagrams in `public_api` are classified separately so their lobster items flow
through `public_api_lobster_files` for failure-mode traceability.

Mermaid diagrams are also available in Sphinx-authored `.rst` and `.md`
sources via the bundled `sphinxcontrib-mermaid` extension, but unlike `.puml`
inputs they are not parsed into FlatBuffers or LOBSTER artifacts.

---

## `unit`
Expand Down
2 changes: 2 additions & 0 deletions bazel/rules/rules_score/private/dependable_element.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ def dependable_element(
maturity = "release",
sphinx = Label("//bazel/rules/rules_score:score_build"),
testonly = True,
extra_opts = [],
**kwargs):
"""Define a dependable element (Safety Element out of Context - SEooC) following S-CORE process guidelines.

Expand Down Expand Up @@ -1333,6 +1334,7 @@ def dependable_element(
deps = [d + "_doc" for d in deps],
sphinx = sphinx,
testonly = testonly,
extra_opts = extra_opts,
**kwargs
)

Expand Down
8 changes: 7 additions & 1 deletion bazel/rules/rules_score/private/sphinx_module.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def _score_needs_impl(ctx):
"--log-level",
get_log_level(ctx),
]
for opt in ctx.attr.extra_opts:
needs_args.append(ctx.expand_location(opt, targets = ctx.attr.srcs))
ctx.actions.run(
inputs = needs_inputs,
outputs = [needs_output],
Expand Down Expand Up @@ -277,7 +279,10 @@ def _score_html_impl(ctx):
# ======================================================================================
_score_needs = rule(
implementation = _score_needs_impl,
attrs = sphinx_rule_attrs,
attrs = dict(
sphinx_rule_attrs,
extra_opts = attr.string_list(doc = "Regular additional string options to pass onto Sphinx."),
),
toolchains = ["//bazel/rules/rules_score:toolchain_type"],
)
_score_html = rule(
Expand Down Expand Up @@ -349,6 +354,7 @@ def sphinx_module(
index = index,
deps = [d + "_needs" for d in deps],
testonly = testonly,
extra_opts = extra_opts,
**kwargs
)
_score_html(
Expand Down
1 change: 1 addition & 0 deletions bazel/rules/rules_score/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rst2pdf
sphinx
sphinx-needs
sphinx-design
sphinxcontrib-mermaid
sphinxcontrib-plantuml
sphinxcontrib-umlet
sphinx-rtd-theme
Expand Down
4 changes: 4 additions & 0 deletions bazel/rules/rules_score/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,10 @@ sphinxcontrib-jsmath==1.0.1 \
--hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \
--hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8
# via sphinx
sphinxcontrib-mermaid==2.0.0 \
--hash=sha256:59a73249bbee2c74b1a4db036f8e8899ade65982bdda6712cf22b4f4e9874bb5 \
--hash=sha256:cf4f7d453d001132eaba5d1fdf53d42049f02e913213cf8337427483bfca26f4
# via -r bazel/rules/rules_score/requirements.in
sphinxcontrib-plantuml==0.31 \
--hash=sha256:fd74752f8ea070e641c3f8a402fccfa1d4a4056e0967b56033d2a76282d9f956
# via -r bazel/rules/rules_score/requirements.in
Expand Down
1 change: 1 addition & 0 deletions bazel/rules/rules_score/test/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ sphinx
sphinx-needs
sphinx-design
myst-parser
sphinxcontrib-mermaid
sphinxcontrib-plantuml
sphinx-rtd-theme
4 changes: 4 additions & 0 deletions bazel/rules/rules_score/test/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ sphinxcontrib-jsmath==1.0.1 \
--hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \
--hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8
# via sphinx
sphinxcontrib-mermaid==2.0.0 \
--hash=sha256:59a73249bbee2c74b1a4db036f8e8899ade65982bdda6712cf22b4f4e9874bb5 \
--hash=sha256:cf4f7d453d001132eaba5d1fdf53d42049f02e913213cf8337427483bfca26f4
# via -r requirements.in
sphinxcontrib-plantuml==0.31 \
--hash=sha256:fd74752f8ea070e641c3f8a402fccfa1d4a4056e0967b56033d2a76282d9f956
# via -r requirements.in
Expand Down