utils
_utils
Shared utilities for audit check modules.
load_exclusions(project)
Load per-package check exclusions from pyproject.toml.
Reads the [tool.axm-init].exclude key and returns check name
prefixes that should be auto-passed for this package.
Example config::
[tool.axm-init]
exclude = ["cli", "changelog", "deps.entry_points"]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Path
|
Path to the project root containing |
required |
Returns:
| Type | Description |
|---|---|
set[str]
|
Set of check name prefixes to exclude. Empty set if no |
set[str]
|
exclusions are configured. |
Source code in packages/axm-init/src/axm_init/checks/_utils.py
requires_toml(check_name, category, weight, fix)
Decorator that loads pyproject.toml and passes data to the check.
If pyproject.toml is missing or unparsable, returns a failure
CheckResult immediately — eliminating the repeated null-guard
preamble from every check function.
The decorated function receives (project, data) instead of just
(project) — where data is the parsed TOML dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
check_name
|
str
|
Check result name (e.g. |
required |
category
|
str
|
Category key (e.g. |
required |
weight
|
int
|
Points weight for this check. |
required |
fix
|
str
|
Fix message for the "not found" failure. |
required |