contracts.types

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

Contracts result and issue types.

Contracts result and issue types.

contracts.types

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

ContractCheck
class

Protocol for custom contract check plugins.

Both plain functions and callable class instances satisfy this protocol. Register viaapp.register_contract_check().

Example — function form::

def my_check(snapshot: ContractCheckSnapshot, result: CheckResult) -> None:
    for name, source in snapshot.template_sources.items():
        if "TODO" in source:
            result.issues.append(
                ContractIssue(Severity.WARNING, "todo", f"TODO in {name}", template=name)
            )

Example — class form::

class ComponentCheck:
    def __call__(self, snapshot: ContractCheckSnapshot, result: CheckResult) -> None:
        ...
Severity
class

Severity of a contract validation issue.

ContractIssue
class

A single validation issue found during contract checking.

ContractCoverage
class

High-level coverage counters for serious hypermedia apps.

CheckResult
class

Result of a hypermedia surface check.

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