On this page
Library boundary linter spanning Python, Go, and npm that flags accidental external exposure of internal symbols so public APIs stay deliberate.
#rlsbl.lint
#rlsbl.lint
Multi-language library boundary linter that detects accidental external exposure of internal symbols across Python, Go, and npm libraries to keep public APIs clean and intentional.
Public API: lint_library(project_path) -> list[LintResult]
Import scanning is NOT here. rlsbl.import_scanners and rlsbl.dep_validation drive the per-language scanners directly -- the linters' own scan_imports methods for Python and npm, and rlsbl.lint.go_ast.scan_imports per file for Go. A project-wide scan_imports used to sit in this module as a third way in; nothing in production ever called it.
#_detect_languages
def _detect_languages(project_path: str) -> list[str]Detect which languages are present in the project.
Derived from the LANGUAGES table's declared manifests, in table order.
#_create_linter
def _create_linter(language: str, parser_type: str)Create the linter for a language and parser type.
Raises on an unknown language rather than returning None: a caller that got here with a language the table does not declare has a bug, and a silent None would turn it into a lint that reports nothing and passes.
#lint_library
def lint_library(project_path: str, *, allowed_imports: list[str] | None=None, check_timeout: int | None=None, releasable_lint_dir: str | None=None) -> list[LintResult]Analyze a project for library boundary violations.
Detects languages present in the project, loads per-language config, and runs the appropriate linter for each.
Args:
project_path: path to the project root directory.allowed_imports: optional list of imports to allow (merged with
per-project TOML allow-list). Typically from workspace.toml lint_allow.
check_timeout: optional subprocess timeout in seconds. Passed to
linters that shell out (e.g. MavenLinter). Defaults to 120 when None.
releasable_lint_dir: optional path to the releasable-levellint/
directory. When the member has no per-language lint config of its own, the releasable-level config in this directory is used.
Returns a list of LintResult namedtuples.