Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python package allowing you to manage your CHANGELOG.md files

License

NotificationsYou must be signed in to change notification settings

tomtom-international/keepachangelog-manager

Python package allowing you to manage yourCHANGELOG.md files

gif

Installation

In order to install the python scripts you can use the following command:

% pip install keepachangelog-manager

Usage

Usage: changelogmanager [OPTIONS] COMMAND [ARGS]...  (Keep a) Changelog ManagerOptions:  --config TEXT                   Configuration file  --component TEXT                Name of the component to update  -f, --error-format [llvm|github]                                  Type of formatting to apply to error                                  messages  --input-file TEXT               Changelog file to work with  --help                          Show this message and exit.Commands:  add             Command to add a new message to the CHANGELOG.md  create          Command to create a new (empty) CHANGELOG.md  github-release  Deletes all releases marked as 'Draft' on GitHub and...  release         Release changes added to [Unreleased] block  to-json         Exports the contents of the CHANGELOG.md to a JSON file  validate        Command to validate the CHANGELOG.md for inconsistencies  version         Command to retrieve versions from a CHANGELOG.md

Validate the layout of your CHANGELOG.md

Although every command will validate the contents of yourCHANGELOG.md, thecommandvalidate will do nothing more than this.

% changelogmanager validate

You can change the error messages to GitHub format by providing the--error-formatoption:

% changelogmanager --error-format github validate

Create a new CHANGELOG.md

Creating a newCHANGELOG.md file is as simple as running:

% changelogmanager create

This will create an empty changelog in the current working directory:

#ChangelogAll notable changes to this project will be documented in this file.The format is based on[Keep a Changelog](https://keepachangelog.com/en/1.1.0/),and this project adheres to[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Add a change to your changelog

Theadd command can be used to add a new change to theCHANGELOG.md:

Usage: changelogmanager add [OPTIONS]  Command to add a new message to the CHANGELOG.mdOptions:  -t, --change-type [added|changed|deprecated|removed|fixed|security]                                  Type of the change  -m, --message TEXT              Changelog entry  --help                          Show this message and exit.

The options--change-type and--message can be omitted, providing a simple userinterface for defining the contents:

% changelogmanager add? Specify thetype of your change? Message of the changelog entry to add? Apply changes to your CHANGELOG.md  (Y/n)

In addition, you can provide a single command as well:

% changelogmanager add --change-type added --message"Added an example to the documentation"

This will create a new[Unreleased] entry in yourCHANGELOG.md:

##[Unreleased]###Added- Added an example to the documentation

Retrieving versions

Theversion command can be used to retrieve versions based on theCHANGELOG.md:

Usage: changelogmanager version [OPTIONS]  Command to retrieve versions from a CHANGELOG.mdOptions:  -r, --reference [previous|current|future]                                  Which version to retrieve  --help                          Show this message and exit.

Taking the followingCHANGELOG.md as reference:

##[Unreleased]###Added- Added an example to the documentation##[2.1.0] - 2022-03-09###Fixed- Handle empty`CHANGELOG.md` files gracefully##[2.0.0] - 2022-03-08###Fixed- No longer throw exceptions when releasing`CHANGELOG.md` containing only an`[Unreleased]` section###Added- Added support for creating a new`CHANGELOG.md` file, using the`create` command
% changelogmanager version2.1.0% changelogmanager version --reference previous2.0.0% changelogmanager version --reference future2.2.0

NOTE: Thefuture version is based on the changes listed in the[Unreleased] section in yourCHANGELOG.md (applying Semantic Versioning)

Release a new CHANGELOG.md

Therelease command allows you to "release" any "unreleased" changes:

Usage: changelogmanager release [OPTIONS]  Release changes added to [Unreleased] blockOptions:  --override-version TEXT  Version to release, defaults to auto-resolve  --help                   Show this message and exit.

For example:

% changelogmanager release

This will rename the[Unreleased] section and add the current date next to it, markingthe change as "Released"

Export your CHANGELOG.md to JSON

Theto-json command allows you to export theCHANGELOG.md file into a JSON format:

Usage: changelogmanager to-json [OPTIONS]  Exports the contents of the CHANGELOG.md to a JSON fileOptions:  --file-name TEXT  Filename of the JSON output  --help            Show this message and exit.

For example:

% changelogmanager to-json

This will create a file namedCHANGELOG.json contain content similar to:

{"3.2.0": {"metadata": {"version":"3.2.0","release_date":"2022-08-18","semantic_version": {"major":3,"minor":2,"patch":0,"prerelease":null,"buildmetadata":null          }        },"added": ["The command `to-json` allows you to export the changelog contents in JSON format (useful for external automation purposes)"        ]    }"3.1.0": {...}}

Create/Update Release in GitHub

Thegithub-release command will create/update a draft Release based on the contents of the[Unreleased] section in yourCHANGELOG.md:

Usage: changelogmanager github-release [OPTIONS]  Creates a new (Draft) releasein GithubOptions:  -r, --repository TEXT    Repository  [required]  -t, --github-token TEXT  Github Token  [required]  --draft / --release      Update/Create the GitHub Releasein either Draft or                           Release state  --help                   Show this message and exit.

For example:

% changelogmanager github-release --github-token<PAT> --repository tomtom-international/keepachangelog-manager

Will result in something alike:

Draft Release Example

Providing the--release flag will update and publish the draft Release.

Working with multiple CHANGELOG.md files in a single repository

You can create a configuration file with the following schema:

project:components:  -name:Service Componentchangelog:service/CHANGELOG.md  -name:Client Interfacechangelog:client/CHANGELOG.md

You can provide the--config and--component options to select a specificCHANGELOG.md file, eg.

% changelogmanager --config config.yml --component"Client Interface" version3.7.3

About

Python package allowing you to manage your CHANGELOG.md files

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp