Page-handler contract check.
Apage.py without a recognised HTTP method handler (get/post/
put/delete/patch/head/options, or handleras a
fallback) registers no routes. Hitting it at runtime yields a 404 or a 500
depending on the surrounding layout, with no startup signal that the file
was misconfigured.
This check promotesPageHandlerFindingdiagnostics produced during
page discovery intopage_handlerscontract issues:
kind="missing"→Severity.ERROR— the file defines no handler at all; ship-blocker.kind="typo"→Severity.WARNING— a handler-shaped function (handle,GET,index…) was defined but not recognised.
Severity can be tuned with
app.override_contract_severity("page_handlers", Severity.ERROR).
contracts.rules_page_handlers
| 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_page_handlers
function
def check_page_handlers(findings: list[PageHandlerFinding]) -> list[ContractIssue]
Turn page-discovery handler findings into contract issues.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
findings
|
list[PageHandlerFinding]
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_page_handlers.py:1