MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / lint

Function lint

openkb/cli.py:1921–1936  ·  view source on GitHub ↗

Lint the knowledge base for structural and semantic inconsistencies.

(ctx, fix)

Source from the content-addressed store, hash-verified

1919)
1920@click.pass_context
1921def lint(ctx, fix):
1922 """Lint the knowledge base for structural and semantic inconsistencies."""
1923 kb_dir = _find_kb_dir(ctx.obj.get("kb_dir_override"))
1924 if kb_dir is None:
1925 click.echo("No knowledge base found. Run `openkb init` first.")
1926 return
1927 if fix:
1928 from openkb.lint import fix_broken_links
1929
1930 with kb_ingest_lock(kb_dir / ".openkb"):
1931 files_changed, ghosts = fix_broken_links(kb_dir / "wiki")
1932 if files_changed:
1933 click.echo(f"Fixed {ghosts} wikilink(s) across {files_changed} file(s).")
1934 else:
1935 click.echo("Nothing to fix — all wikilinks resolve.")
1936 asyncio.run(run_lint(kb_dir))
1937
1938
1939@cli.command()

Callers

nothing calls this directly

Calls 6

kb_ingest_lockFunction · 0.90
fix_broken_linksFunction · 0.90
_find_kb_dirFunction · 0.85
run_lintFunction · 0.85
runMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected