herman.core.analysis.message

Analysis message representation.

Classes

Severity

Severity levels for analysis messages.

AnalysisMessage

Message produced during analysis.

Module Contents

class herman.core.analysis.message.Severity[source]

Bases: str, enum.Enum

Severity levels for analysis messages.

ERROR = 'error'[source]
WARNING = 'warning'[source]
NOTICE = 'notice'[source]
property order: int[source]

Order for sorting severities.

property icon: str[source]

Icon representing the severity level.

property color: str[source]

Color associated with the severity level.

__lt__(other: Severity) bool[source]

Compare severities based on their order.

class herman.core.analysis.message.AnalysisMessage[source]

Message produced during analysis.

sort_index: tuple[int, str, int, int, str, str][source]
file: pathlib.Path[source]
message: str[source]
code: str[source]
severity: Severity[source]
line: int | None = None[source]
column: int | None = None[source]
__post_init__() None[source]

Initialize the sort index for ordering messages.

property is_error: bool[source]

Check if the message is an error.

classmethod from_text(file: pathlib.Path, message: str, code: str, severity: Severity = Severity.ERROR) Self[source]

Create an AnalysisMessage from plain text inputs.

classmethod from_pydantic_error(file: pathlib.Path, err: pydantic.ValidationError) list[AnalysisMessage][source]

Convert a Pydantic ValidationError into AnalysisMessages.

Extracts line & column if possible.

to_dict() dict[str, str | int | None][source]

JSON-friendly format.

to_rich() rich.panel.Panel[source]

Rich panel for local console output.

to_github_annotation() str[source]

GitHub Actions annotation format.