contracts.rules_kida_analysis

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Kida 0.9 static-analysis contract checks.

Kida 0.9 static-analysis contract checks.

contracts.rules_kida_analysis

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

collect_literal_attributes
function
def collect_literal_attributes(kida_env: Environment, template_sources: dict[str, str]) -> dict[str, tuple[Any, ...]]

Collect Kida literal attributes once for contract rules that need them.

Parameters

Name Type Default Description
kida_env Environment
template_sources dict[str, str]
literal_route_targets
function
def literal_route_targets(attrs: Iterable[Any]) -> list[tuple[str, str, str | None]]

Extract static hx-* route targets from Kida literal attributes.

Parameters

Name Type Default Description
attrs Iterable[Any]
literal_static_ids
function
def literal_static_ids(attrs: Iterable[Any]) -> set[str]

Extract static id= values from Kida literal attributes.

Parameters

Name Type Default Description
attrs Iterable[Any]
literal_hx_target_selectors
function
def literal_hx_target_selectors(attrs: Iterable[Any]) -> list[str]

Extract static hx-target values from Kida literal attributes.

Parameters

Name Type Default Description
attrs Iterable[Any]
literal_href_references
function
def literal_href_references(attrs: Iterable[Any]) -> set[str]

Extract static href= route references from Kida literal attributes.

Parameters

Name Type Default Description
attrs Iterable[Any]
literal_htmx_partial_sources
function
def literal_htmx_partial_sources(attrs: Iterable[Any]) -> list[str]

Extract static route references from literal attributes.

Parameters

Name Type Default Description
attrs Iterable[Any]
check_component_calls
function
def check_component_calls(kida_env: Environment, template_sources: dict[str, str]) -> tuple[list[ContractIssue], int]

Validate local Kida component calls and literal argument types.

Parameters

Name Type Default Description
kida_env Environment
template_sources dict[str, str]
check_template_context_contracts
function
def check_template_context_contracts(kida_env: Environment, template_sources: dict[str, str], extras: Mapping[str, Any]) -> list[ContractIssue]

Validate opt-in dotted template context contracts with Kida.

Parameters

Name Type Default Description
kida_env Environment
template_sources dict[str, str]
extras Mapping[str, Any]
check_template_escape_audit
function
def check_template_escape_audit(kida_env: Environment, template_sources: dict[str, str]) -> list[ContractIssue]

Surface Kida trusted-markup findings without failing startup.

Parameters

Name Type Default Description
kida_env Environment
template_sources dict[str, str]
check_template_privacy
function
def check_template_privacy(kida_env: Environment, template_sources: dict[str, str]) -> list[ContractIssue]

Surface Kida privacy lint findings as warning-level contract diagnostics.

Parameters

Name Type Default Description
kida_env Environment
template_sources dict[str, str]

View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_kida_analysis.py:1