topmark.core.exit_codes¶
Exit codes for the TopMark runtime and CLI.
This module centralizes the exit codes used by the CLI, engine helpers, and
tests. TopMark aligns with the BSD sysexits convention where practical so
that other tooling can interpret failures consistently. The one deliberate
divergence is WOULD_CHANGE = 2, which is used to signal a dry-run state
where changes would be made; this allows automation and tests to distinguish
between a "would change" result and a usage error (which, in Click, also
defaults to 2). When used with Click-based CLIs, tests must assert
result.exception is None to disambiguate TopMark's dry-run from Click's
own usage errors.
ExitCode ¶
Bases: IntEnum
Standardized exit codes for the TopMark runtime and CLI.
TopMark follows the BSD sysexits convention where practical so other
tooling can interpret failures consistently. The one deliberate
divergence is WOULD_CHANGE = 2, which TopMark uses to signal a dry-run
state where changes would be made. When running under a Click-based CLI,
tests must assert that no Click exception was raised
(result.exception is None) to disambiguate from Click's own usage
errors (which also default to 2).
Attributes:
| Name | Type | Description |
|---|---|---|
SUCCESS |
Successful execution with no errors. |
|
FAILURE |
Generic failure (non-specific error). Prefer a more specific code if available. |
|
WOULD_CHANGE |
Dry-run: changes would be made if |
|
USAGE_ERROR |
Command-line invocation error (invalid flags/args). Mirrors
BSD |
|
ENCODING_ERROR |
Text decoding/encoding error (e.g., UnicodeDecodeError).
Mirrors BSD |
|
FILE_NOT_FOUND |
Input path does not exist. Mirrors BSD |
|
UNSUPPORTED_FILE_TYPE |
Known/unsupported file type encountered (skipped
as per policy). Mirrors BSD |
|
PIPELINE_ERROR |
Internal pipeline failure (processor/step contract
violation). Mirrors BSD |
|
IO_ERROR |
I/O error reading/writing a file. Mirrors BSD |
|
PERMISSION_DENIED |
Insufficient permissions (read/write). Mirrors BSD
|
|
CONFIG_ERROR |
Configuration error (missing/invalid/malformed config).
Mirrors BSD |
|
VERSION_CONVERSION_ERROR |
Version conversion error (missing/invalid/malformed PEP version
identifier, version cannot be converted tot SemVer).
Mirrors BSD |
|
UNEXPECTED_ERROR |
Unhandled/unknown error (last-resort). Mirrors BSD
|