Skip to content

Commit 2344224

Browse files
author
Arnaud Riess
committed
fix: add docstring for schema generation function in Sphinx setup
1 parent 8307f98 commit 2344224

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/extensions/score_metamodel/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,14 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
250250
config_setdefault(app.config, "needs_reproducible_json", True)
251251
config_setdefault(app.config, "needs_json_remove_defaults", True)
252252

253-
# Generate schemas.json from the metamodel and register it with sphinx-needs.
254-
# This enables sphinx-needs 6 schema validation: required fields, regex
255-
# patterns on option values, and (eventually) link target type checks.
256-
# Use config-inited event to defer file writing until config is ready,
257-
# with error handling to prevent boot crashes on file write failures.
258253
def _write_schemas_with_error_handling(app: Sphinx, config: Config) -> None:
254+
"""Generate schemas.json from the metamodel and register it with sphinx-needs.
255+
256+
This enables sphinx-needs 6 schema validation: required fields, regex
257+
patterns on option values, and (eventually) link target type checks.
258+
Use config-inited event to defer file writing until config is ready,
259+
with error handling to prevent boot crashes on file write failures.
260+
"""
259261
try:
260262
write_sn_schemas(app, metamodel)
261263
except Exception as e:

0 commit comments

Comments
 (0)