OOB swap target cross-reference checks.
Warns when hx-swap-oob targets an ID not found in any template.
contracts.rules_oob_targets
| 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
check_oob_targets
function
def check_oob_targets(template_sources: dict[str, str], all_ids: set[str]) -> list[ContractIssue]
Warn when hx-swap-oob targets an ID not found in any template.
Scans template sources for elements with bothhx-swap-ooband
idattributes, then checks if that ID exists anywhere across
all templates (via the pre-builtall_idsset).
Only catches statically-analyzable targets. Dynamic IDs (Kida expressions) are excluded by design.
Vendoredchirpui/component-library templates are skipped, symmetric
with the id-collection loop inchecker.py(which also skips
chirpui/). The checker treats chirp-ui as opaque: its element ids are
never added toall_ids, so scanning its OOB helper macros here would
always report a false-positive miss (e.g.context_rail_oobtargets
chirpui-context-rail, an id defined only in the skipped
chirpui/app_shell.html). chirp-ui owns its own OOB-target consistency.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
template_sources
|
dict[str, str]
|
— | |
all_ids
|
set[str]
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_oob_targets.py:1