Validate CHANGELOG.md files against the Keep a Changelog specification.
All commands use the bundled Python script at scripts/changelog_linter.py.
python3 scripts/changelog_linter.py lint <file> [--strict] [--format text|json|markdown]
Run all validation rules against a CHANGELOG.md file.
Flags:
--strict — exit code 1 on any warning (not just errors)--format — output format: text (default), json, markdownpython3 scripts/changelog_linter.py versions <file> [--format text|json]
Extract and display all versions with dates and change counts.
python3 scripts/changelog_linter.py order <file> [--format text|json]
Check that versions are in descending semver order.
python3 scripts/changelog_linter.py links <file> [--format text|json]
Verify that all version headers have corresponding link references at the bottom.
# Changelog[Unreleased] section- and *)CHANGELOG.md:15 error [invalid-date] Version 1.2.0 has invalid date: "March 2024" (expected YYYY-MM-DD)
CHANGELOG.md:28 warning [empty-section] Section "Deprecated" under 1.1.0 has no entries
CHANGELOG.md:45 warning [missing-link-ref] Version 1.0.0 has no link reference
3 issues (1 error, 2 warnings)
Standard structured output with issues, summary, and version list.
- name: Lint Changelog
run: python3 scripts/changelog_linter.py lint CHANGELOG.md --strict
Exit codes: 0 = valid, 1 = issues found.
共 1 个版本