Skip to main content

check-changelog

pkg - version pkg - python versions pkg - license


The project's aims are:

The supported changelog style is Keep A Changelog style with these additions:

  • allow changelog notes

    # Changelog
    Changelog notes
    
    ## [Unreleased]
    
  • allow release notes (Common Changelog addition)

    ## [1.0.0] - 2023-05-05
    Release notes
    
    ### Added
     - add feature ...
    
  • allow custom footer to separate tech stuff from changelog content. 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
    

Installation

pip install check-changelog

Usage

From command line

Check changelog style

check-changelog --check-style=yes

Ensure git tags are documented in a changelog

check-changelog --check-tags=history

Add Unreleased section to a changelog, create a new changelog if needed

check-changelog --release=new

Create release 3.3.3 from current Unreleased section

check-changelog --release="3.3.3"
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -2,6 +2,8 @@

 ## [Unreleased]

+## [3.3.3] - 2023-07-17
+
 ### Changed

  - some change
@@ -20,6 +22,7 @@
 ## [0.1.0] - 2023-07-11

 [Unreleased]: https://github.com/aanatoly/check-changelog
+[3.3.3]: https://github.com/aanatoly/check-changelog/releases/tag/3.3.3
 [0.3.0]: https://github.com/aanatoly/check-changelog/releases/tag/0.3.0
 [0.2.1]: https://github.com/aanatoly/check-changelog/releases/tag/0.2.1

pre-commit hook

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

- repo: https://github.com/aanatoly/check-changelog
  rev: '0.4.1'
  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-hook

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 python-kacl. It is a feature-rich tool capable of linting, fixing errors, and automating Changelog maintenance.

Development

See development doc

Release files for check-changelog 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for check-changelog 0.4.1
File Interpreter ABI Platform
check_changelog-0.4.1-py3-none-any.whl Python 3 none any Details

Release files / check_changelog-0.4.1-py3-none-any.whl

Download URL check_changelog-0.4.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fff75548ede54e6694c597d32b2add4e0aea0ea400c04c4f54199cdf7352ecc9
BLAKE2b-256 checksum
How to use checksums
dfe297d7c28e76e37b97a1d5daee4c6f1c67c96c14626b79792f7d35de96be99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.8.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.4.1 This release

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page