Package: changelog-cmd
changelog-cmdTool for managing a changelog in the style ofKeep a Changelog.Features:Write new changelog entries in a consistent mannerValidate and format your changelogSuggest semantic version of releases based on their contentsWrite scripts which make automated changes and updates to changelogs, whilst keeping the changelog in a human-readable formatInstallationRequires Python 3.9 or higher.pipinstallchangelog-cmdUsageStarting a changelogCreate a changelog namedCHANGELOG.mdin the current directory by runningchangeloginit--release-link-format=RELEASE_LINK_FORMATWhere the--release-link-formatoption specifies how to generate links to a given release, and is given using a Python string format specifier. For example, if you want to link to source on GitHub, this format specifier might be:https://github.com/user/repo/tree/{tag}- the source code at this releasehttps://github.com/user/repo/compare/{previous_tag}...{tag}- a comparison of this release with the one beforeOr if you want to link to PyPi, the format might be:https://pypi.org/project/package/{tag}/Above you see the two variables available for substitution:tagis the tag of the releaseprevious_tagis the tag of the previous releaseFinding the changelogBy default,changeloglooks for a changelog calledCHANGELOG.mdin the current directory. You can override this by passing a command-line option:changelog--pathpath/to/changelog.md...Or you can set an environment variable:CHANGELOG_PATH=path/to/changelog.md...The command-line option takes precedence.Adding entries to a changelogAdd an entry to the unreleased section of a changelog:changelogentryadded--message"Description of my change"You can replaceaddedin the above with any of the following types of entry:addedchangeddeprecatedfixedremovedsecurityTo specify a change as breaking, simply include the--breakingflag:changelogentrychanged--message"Description of a breaking change"--breakingIf you need to add a missing entry to a past release, you can specify the release tag explicitly:changelogentryfixed--message"Description of a fix"--tag"0.1.1"Cutting a releaseWhen you are ready to cut a release, run the following:changelogreleaseThis will identify the correct semantic version. Alternatively, you can specify the semantic version bump yourself:changelogrelease--bump"major"Or, if you don't use semantic versioning at all, simply specify the tag of the release:changelogrelease--tag"2021.r3"Formatting and validationUsing this tool should not preclude manual editing of a changelog. To ensure that manual changes don't break conventions, you can use the following two commands in your development workflow:Simply check that the changelog is still in a recognisable format:changelogvalidateFormat the changelog in a standard manner:changelogformatChangelog configurationThis tool stores configuration in the changelog itself. The currently available config fields are:release_link_formatspecifies the format for release linksbreaking_change_tokenspecifies the token for breaking changesCheck the value of a config field via:changelogconfigget--fieldCONFIG_FIELDAnd set it viachangelogconfigset--fieldCONFIG_FIELD--valueVALUEDevelopmentInstall dependencies:pyenvshell3.9.4# Or other 3.9.xpre-commitinstall# Configure commit hookspoetryinstall# Install Python dependenciesRun tests:poetryruninvverifyFuture improvementsThe following is a list of possible future improvements for this tool:Support a release-per-change workflow (every change is tagged as a new release)Support configuration of of change types beyond those specified byKeep a ChangelogExtensions to help interaction withgit, e.g. merge conflict resolution and/or validation.LicenseThis project is distributed under the MIT license.