rlsbl v0.92.0 /rlsbl.lint
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] scan_imports(project_path) -> set (ImportRecord or tuples)

#_detect_languages

python
def _detect_languages(project_path: str) -> list[str]

Detect which languages are present in the project.

#_create_linter

python
def _create_linter(language: str, parser_type: str)

Create the appropriate linter instance for a language and parser type.

#_create_import_scanner

python
def _create_import_scanner(language: str)

Create an AST-based import scanner for a language.

Import scanning always uses the AST parser (not regex) since it needs accurate import extraction.

#lint_library

python
def lint_library(project_path: str, *, allowed_imports: list[str] | None=None, check_timeout: int | 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.

Returns a list of LintResult namedtuples.

#scan_imports

python
def scan_imports(project_path: str) -> set

Collect all imports from source files in a project.

Detects languages present and uses AST-based scanners to extract every import statement found.

Args:

  • project_path: path to the project root directory.

Returns a set of import records. Python imports are ImportRecord dataclasses (top_level, full_path, filepath, line, guarded, type_checking). npm imports are (package_name, file_path, line_number, guarded) tuples.