"""Typing contract: no wildcard annotation types in src/auen."""

from __future__ import annotations

from tests.typing.conftest import ViolationTuple


def _format(violations: list[ViolationTuple]) -> str:
    return "\n".join(
        f"{path}:{line}:{column + 1} [{kind}] {message}"
        for kind, path, line, column, message in violations
    )


def test_no_wildcard_annotations(
    typing_contract_violations: list[ViolationTuple],
) -> None:
    wildcard_violations = [
        item
        for item in typing_contract_violations
        if item[0] in {"annotation-any", "annotation-object"}
    ]
    assert not wildcard_violations, _format(wildcard_violations)
