Skip to main content

check that changelog conforms to 'Keep A Changelog' style

Project description

check-changelog

pkg - version pkg - python versions pkg - license


The project's aims are:

Main features:

  • check that changelog conforms to Keep A Changelog style

  • allow release notes. Add them between the release header and change list (Common Changelog addition)

    ## [1.0.0] - 2023-05-05
    Release notes
    
    ### Added
     - add feature ...
    
  • allow custom footer to keep things from being verified. Useful for legal notes, text used by other scripts, HTML comments, etc

    -----
    Linter will ignore this section.
    <!--- message for some script -->
    [my site]: http://mysite.com
    
  • gcc style error reports

    CHANGELOG.md:10: bad release title: [0.2.1]; expected '[Unreleased]' or '[ver] - YYYY-MM-DD'
    CHANGELOG.md:12: bad change type: Changed2; expected one of ['Added', 'Changed', ...]
    

Installation

pip install check-changelog

Usage

From command line

# check CHANGELOG.md in a current dir
check-changelog
check-changelog --check=yes --tags=   # default settings
# check CHANGELOG.md and git tags
check-changelog --check=yes --tags=history

As a pre-commit hook. Add this section to your .pre-commit-config.yaml

- repo: https://github.com/aanatoly/check-changelog
  rev: '0.3.0'
  hooks:
    - id: check-changelog

git pre-push hook

As a git pre-push hook, check-changelog can block git from pushing tags without changelog. To install it that way, run the following commmands

# backup existing hook
mv .git/hooks/pre-push  .git/hooks/pre-push.bak
# install new hook
check-changelog --install=yes

and let's test it

git tag -a -m "abc.7.7" "abc.7.7"
git tag -a -m "abc.7.8" "abc.7.8"
git push --tags --dry-run

# check-changelog :: INFO  :: file CHANGELOG.md: starting
# check-changelog :: INFO  :: task check tags documentation: starting
# check-changelog :: INFO  :: scan 2 tags from 'hook' source
# check-changelog :: ERROR :: tag 'abc.7.7' not found
# check-changelog :: ERROR :: tag 'abc.7.8' not found
# check-changelog :: ERROR :: task check tags documentation: fail
# check-changelog :: ERROR :: file CHANGELOG.md: fail

git tag -d "abc.7.7"
git tag -d "abc.7.8"

Alternatives

check-changelog is a minimalistic tool by design. It checks the Changelog structure and does nothing else.

If you are looking for more, check python-kacl. It is a feature-rich tool capable of linting, fixing errors, and automating Changelog maintenance.

Development

See development doc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

check_changelog-0.3.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file check_changelog-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for check_changelog-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afb45efbc0f9f9ba7638ecbef26ded84d246f10e80b431e31af6b4f29ad64786
MD5 8845398114a2aa22397f43bab7beec2e
BLAKE2b-256 f1df4d884878042e7b2cdb2c15b526ec5d20fcf992a1fc4fc0ea348d0d34b557

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page