Structure
structure
Structure rules — file and directory existence checks.
DirectoryExistsRule
dataclass
Bases: ProjectRule
Rule that checks if a required directory exists.
Not decorated with @register_rule — this rule is consumed by
axm-init checklist checks, not auto-discovered during audits.
The category property is set manually for the same reason.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
category
property
Scoring category for this rule.
rule_id
property
Unique identifier for this rule.
check(project_path)
Check if the directory exists in the project.
Returns a passing result when the directory is present, or a failing
result with fix_hint="mkdir {dir_name}" when missing.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
FileExistsRule
dataclass
Bases: ProjectRule
Rule that checks if a required file exists.
Not decorated with @register_rule — this rule is consumed by
axm-init checklist checks, not auto-discovered during audits.
The category property is set manually for the same reason.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
category
property
Scoring category for this rule.
rule_id
property
Unique identifier for this rule.
check(project_path)
Check if the file exists in the project.
Returns a passing result when the file is present, or a failing
result with fix_hint="touch {file_name}" when missing.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
PyprojectCompletenessRule
dataclass
Bases: ProjectRule
Validate PEP 621 field completeness in pyproject.toml.
Checks 9 fields: name, version/dynamic, description, requires-python, license, authors, classifiers, urls, readme. Scoring: (fields_present / 9) x 100.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
rule_id
property
Unique identifier for this rule.
check(project_path)
Check pyproject.toml completeness.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
TestsPyramidRule
dataclass
Bases: ProjectRule
Verify the 3-level test pyramid layout and pytest markers.
Checks that tests/unit/, tests/integration/ and tests/e2e/
exist (tests/e2e/ is optional for library packages) and that
pyproject.toml declares the integration and e2e pytest
markers required by the project's strict-markers policy.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
rule_id
property
Unique identifier for this rule.
check(project_path)
Check the test pyramid layout and required markers.
Source code in packages/axm-audit/src/axm_audit/core/rules/structure.py
check_fields(project)
Check present PEP 621 fields in project table.
Returns (present_count, missing_field_names).