Module

_check

Private diagnostic collection forkida check.

The collector preserves the existing human-output phase order while giving JSON and SARIF renderers one deduplicated set of canonical diagnostics.

Classes

CheckDiagnosticEvent 3 ▼
One canonical diagnostic plus its compatibility text rendering.

One canonical diagnostic plus its compatibility text rendering.

Attributes

Name Type Description
diagnostic Diagnostic —
phase str —
text str —
CheckSummaryEvent 2 ▼
One human-only phase or final summary line.

One human-only phase or final summary line.

Attributes

Name Type Description
phase str —
text str —
CheckResult 5 ▼
Complete result of one check invocation.

Complete result of one check invocation.

Attributes

Name Type Description
root str —
events tuple[CheckEvent, ...] —
partial bool —
exit_code int —

Methods

diagnostics 0 tuple[Diagnostic, ...] ▼
Return diagnostics ordered by phase, path, range, code, and message.
property
def diagnostics(self) -> tuple[Diagnostic, ...]
Returns
tuple[Diagnostic, ...]
_CheckEntry 4 ▼

Attributes

Name Type Description
name str —
source_path Path —
owner str | None —
validate_call_types bool —
_Collector 4 ▼

Methods

add 3 bool ▼
def add(self, diagnostic: Diagnostic, *, phase: str, text: str) -> bool
Parameters
Name Type Description
diagnostic —
phase —
text —
Returns
bool
summary 2 ▼
def summary(self, *, phase: str, text: str) -> None
Parameters
Name Type Description
phase —
text —
build 1 CheckResult ▼
def build(self, *, exit_code: int) -> CheckResult
Parameters
Name Type Description
exit_code —
Returns
CheckResult
Internal Methods 1 ▼
__init__ 2 ▼
def __init__(self, root: str | Path, *, source_metadata: dict[str, tuple[str, str]] | None = None) -> None
Parameters
Name Type Description
root —
source_metadata — Default:None

Functions

_with_inventory_metadata 3 Diagnostic ▼
Attach root ownership without changing the logical diagnostic path.
def _with_inventory_metadata(diagnostic: Diagnostic, *, owner: str, source_path: str) -> Diagnostic
Parameters
Name Type Description
diagnostic Diagnostic
owner str
source_path str
Returns
Diagnostic
_exception_template_path 3 str ▼
Prefer the actual failing imported template over its caller.
def _exception_template_path(exc: Exception, fallback: str, source_names: dict[str, str] | None = None) -> str
Parameters
Name Type Description
exc Exception
fallback str
source_names dict[str, str] | None Default:None
Returns
str
_loader_ownership_diagnostic 3 Diagnostic ▼
Reject an adapter loader that resolves an inventoried name elsewhere.
def _loader_ownership_diagnostic(*, name: str, expected_path: Path, actual_path: str | None) -> Diagnostic
Parameters
Name Type Description
name str
expected_path Path
actual_path str | None
Returns
Diagnostic
collect_check_diagnostics 6 CheckResult ▼
Collect all enabled ``kida check`` findings without rendering a surface.
def collect_check_diagnostics(template_dir: Path, *, strict: bool, validate_calls: bool, a11y: bool, typed: bool, lint_fragile_paths: bool) -> CheckResult
Parameters
Name Type Description
template_dir Path
strict bool
validate_calls bool
a11y bool
typed bool
lint_fragile_paths bool
Returns
CheckResult
collect_inventory_diagnostics 7 CheckResult ▼
Collect diagnostics from a validated explicit root inventory.
def collect_inventory_diagnostics(inventory: _RootInventory, *, environment: Environment, strict: bool, validate_calls: bool, a11y: bool, typed: bool, lint_fragile_paths: bool) -> CheckResult
Parameters
Name Type Description
inventory _RootInventory
environment Environment
strict bool
validate_calls bool
a11y bool
typed bool
lint_fragile_paths bool
Returns
CheckResult
_collect_diagnostics 9 CheckResult ▼
Run the shared single- and multi-root diagnostic pipeline.
def _collect_diagnostics(root: str, entries: tuple[_CheckEntry, ...], *, environment: Environment, configuration_diagnostics: tuple[Diagnostic, ...], strict: bool, validate_calls: bool, a11y: bool, typed: bool, lint_fragile_paths: bool) -> CheckResult
Parameters
Name Type Description
root str
entries tuple[_CheckEntry, ...]
environment Environment
configuration_diagnostics tuple[Diagnostic, ...]
strict bool
validate_calls bool
a11y bool
typed bool
lint_fragile_paths bool
Returns
CheckResult
collect_source_diagnostics 8 CheckResult ▼
Collect canonical diagnostics for one unsaved source buffer. The source is par…
def collect_source_diagnostics(source: str, *, name: str, environment: Environment | None, strict: bool, validate_calls: bool, a11y: bool, typed: bool, lint_fragile_paths: bool) -> CheckResult

Collect canonical diagnostics for one unsaved source buffer.

The source is parsed directly rather than compiled through from_string(), so it never enters template or bytecode caches. A caller-supplied environment is consulted only for parser settings, extensions, autoescape selection, and imported definition metadata.

Parameters
Name Type Description
source str
name str
environment Environment | None
strict bool
validate_calls bool
a11y bool
typed bool
lint_fragile_paths bool
Returns
CheckResult