core.registry.CheckRegistry

core.registry.CheckRegistry()

Registry for storing and filtering check classes.

Provides methods to add, retrieve, and filter checks by group or ID.

Methods

Name Description
add Register a check class.
filter Filter checks by group and/or ID.
get Get a check class by ID.
get_by_group Get all checks belonging to a specific group.
get_by_id_or_name Get a check class by ID or name (case-insensitive).
get_groups Get all unique groups in registration order.
get_required_fixtures Collect all required fixtures for the specified checks.

add

core.registry.CheckRegistry.add(check_class)

Register a check class.

Args: check_class: The check class to register

Raises: ValueError: If a check with the same ID is already registered

filter

core.registry.CheckRegistry.filter(
    only_groups=None,
    skip_groups=None,
    only_ids=None,
    skip_ids=None,
)

Filter checks by group and/or ID.

Args: only_groups: If provided, only include checks from these groups skip_groups: If provided, exclude checks from these groups only_ids: If provided, only include checks with these IDs skip_ids: If provided, exclude checks with these IDs

Yields: Check classes matching the filter criteria

get

core.registry.CheckRegistry.get(check_id)

Get a check class by ID.

Args: check_id: The check ID to retrieve

Returns: The check class, or None if not found

get_by_group

core.registry.CheckRegistry.get_by_group(group)

Get all checks belonging to a specific group.

Args: group: The group name to filter by

Yields: Check classes in the specified group

get_by_id_or_name

core.registry.CheckRegistry.get_by_id_or_name(identifier)

Get a check class by ID or name (case-insensitive).

Searches first by ID (exact match, then case-insensitive), then by name (case-insensitive).

Args: identifier: Check ID (e.g., “ST001”) or name (e.g., “HasReadme”)

Returns: The check class, or None if not found

get_groups

core.registry.CheckRegistry.get_groups()

Get all unique groups in registration order.

Returns: List of unique group names in the order they were first registered

get_required_fixtures

core.registry.CheckRegistry.get_required_fixtures(check_ids)

Collect all required fixtures for the specified checks.

Args: check_ids: List of check IDs to collect fixtures for

Returns: Set of all fixture names required by the specified checks