Classes
_Palette
1
▼
ANSI escape sequences — empty strings when color is disabled.
_Palette
1
▼
ANSI escape sequences — empty strings when color is disabled.
Methods
Internal Methods 1 ▼
__init__
1
▼
__init__
1
▼
def __init__(self, *, enabled: bool) -> None
Parameters
| Name | Type | Description |
|---|---|---|
enabled |
— |
Functions
_use_color
1
bool
▼
True if the output stream supports ANSI color.
_use_color
1
bool
▼
def _use_color(stream: object | None = None) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
stream |
object | None |
Default:None
|
Returns
bool
_severity_icon
2
str
▼
Colored icon for an issue severity.
_severity_icon
2
str
▼
def _severity_icon(severity: Severity, c: _Palette) -> str
Parameters
| Name | Type | Description |
|---|---|---|
severity |
Severity |
|
c |
_Palette |
Returns
str
_format_issue
2
list[str]
▼
Format a single issue as indented lines.
_format_issue
2
list[str]
▼
def _format_issue(issue: ContractIssue, c: _Palette) -> list[str]
Parameters
| Name | Type | Description |
|---|---|---|
issue |
ContractIssue |
|
c |
_Palette |
Returns
list[str]
format_check_result
2
str
▼
Format a CheckResult for rich terminal display.
format_check_result
2
str
▼
def format_check_result(result: CheckResult, *, color: bool | None = None) -> str
Parameters
| Name | Type | Description |
|---|---|---|
result |
CheckResult |
The check result to format. |
color |
bool | None |
Force color on/off. None
|
Returns
str