generated from coulomb/repo-seed
Complete WP-0006 through WP-0009: registry expansion, catalog, graph, tests
Some checks failed
ci / validate-registry (push) Has been cancelled
Some checks failed
ci / validate-registry (push) Has been cancelled
Register six new capabilities (12 total), add searchable catalog UI and graph explorer, introduce pytest suite with CI fail-on-warnings, and close gap analysis priorities 13 and 16. WP-0010 remains backlog for network federation.
This commit is contained in:
@@ -64,7 +64,7 @@ def cmd_validate(args: argparse.Namespace) -> int:
|
||||
for error in errors:
|
||||
print(f"error: {error}", file=sys.stderr)
|
||||
|
||||
if errors:
|
||||
if errors or (args.fail_on_warnings and warnings):
|
||||
return 1
|
||||
print(f"ok: validated {len(paths)} capability entr{'y' if len(paths) == 1 else 'ies'}")
|
||||
return 0
|
||||
@@ -167,18 +167,27 @@ def cmd_graph(args: argparse.Namespace) -> int:
|
||||
print(content, end="")
|
||||
else:
|
||||
path = write_graph()
|
||||
from reuse_surface.catalog import GRAPH_HTML, render_graph_explorer
|
||||
|
||||
GRAPH_HTML.parent.mkdir(parents=True, exist_ok=True)
|
||||
GRAPH_HTML.write_text(render_graph_explorer(content), encoding="utf-8")
|
||||
print(f"ok: wrote {path.relative_to(ROOT)}")
|
||||
print(f"ok: wrote {GRAPH_HTML.relative_to(ROOT)}")
|
||||
for warning in warnings:
|
||||
print(f"warning: {warning}", file=sys.stderr)
|
||||
if args.fail_on_warnings and warnings:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_catalog(args: argparse.Namespace) -> int:
|
||||
index = load_index()
|
||||
indexed_entries = _load_indexed_entries()
|
||||
md_path, html_path = write_catalog(index, indexed_entries)
|
||||
print(f"ok: wrote {md_path.relative_to(ROOT)}")
|
||||
print(f"ok: wrote {html_path.relative_to(ROOT)}")
|
||||
paths = write_catalog(
|
||||
index, indexed_entries, mermaid_source=render_mermaid()
|
||||
)
|
||||
for path in paths:
|
||||
print(f"ok: wrote {path.relative_to(ROOT)}")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -237,6 +246,11 @@ def main(argv: list[str] | None = None) -> int:
|
||||
action="store_true",
|
||||
help="check relation cycles and broken references",
|
||||
)
|
||||
validate.add_argument(
|
||||
"--fail-on-warnings",
|
||||
action="store_true",
|
||||
help="exit non-zero when warnings are present",
|
||||
)
|
||||
validate.set_defaults(func=cmd_validate)
|
||||
|
||||
federation = subparsers.add_parser(
|
||||
@@ -290,6 +304,11 @@ def main(argv: list[str] | None = None) -> int:
|
||||
action="store_true",
|
||||
help="report depends_on cycles and broken relation references",
|
||||
)
|
||||
graph.add_argument(
|
||||
"--fail-on-warnings",
|
||||
action="store_true",
|
||||
help="exit non-zero when relation warnings are present",
|
||||
)
|
||||
graph.set_defaults(func=cmd_graph)
|
||||
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
Reference in New Issue
Block a user