Node changelog gold-standard checks.
Ports the Python checks.changelog convention: the changelog is generated
from conventional commits (changesets / git-cliff / release-please), so a
hand-maintained CHANGELOG.md is an anti-pattern. We accept any of the
recognised generators as evidence the changelog is automated.
check_changelog_automated(project)
Check: the changelog is automated (no hand-maintained CHANGELOG.md).
Source code in packages/axm-init/src/axm_init/checks/node/changelog.py
| Python |
|---|
| def check_changelog_automated(project: Path) -> CheckResult:
"""Check: the changelog is automated (no hand-maintained CHANGELOG.md)."""
has_tooling = _has_changeset_tooling(project)
has_manual = (project / "CHANGELOG.md").is_file()
# A manual CHANGELOG.md is only an issue when no generator is configured.
if has_manual and not has_tooling:
return CheckResult(
name="changelog.changelog_automated",
category="changelog",
passed=False,
weight=2,
message="Manual CHANGELOG.md without a generator",
details=["Use changesets / git-cliff / release-please"],
fix="Adopt @changesets/cli (or git-cliff) to generate the changelog.",
)
if not has_tooling:
return CheckResult(
name="changelog.changelog_automated",
category="changelog",
passed=False,
weight=2,
message="No changelog generator configured",
details=[],
fix="Add @changesets/cli (or git-cliff) for an automated changelog.",
)
return CheckResult(
name="changelog.changelog_automated",
category="changelog",
passed=True,
weight=2,
message="Changelog is automated",
details=[],
fix="",
)
|