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, ...]
_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__ 1
def __init__(self, root: Path) -> None
Parameters
Name Type Description
root

Functions

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_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