Unclog your changelog
Build your changelog from a structured collection of independent files in your
project's .changelog
folder. This helps avoid annoying merge conflicts when
working on multiple PRs simultaneously.
It's assumed your changelog will be output in Markdown format.
Many other tools that provide similar functionality focus on extracting changelog entries from the project's Git commit history. Why don't we just do this?
We find value in targeting different audiences with each kind of content, and being able to tailor content to each audience: Git commit histories for our developers, and changelogs for our users.
cargo
```bash
cargo install unclog ```
Or you can build from source:
bash
cargo install --git https://github.com/informalsystems/unclog.git
.changelog
folderAn example layout for a project's .changelog
folder is as follows:
.changelog/ - The project's .changelog folder, in the root of the repo.
|__ unreleased/ - Changes to be released in the next version.
| |__ breaking-changes/ - "BREAKING CHANGES" section entries.
| | |__ 890-block.md - An entry in the "BREAKING CHANGES" section.
| |
| |__ bug-fixes/ - "BUG FIXES" section entries.
| | |__ module1/ - "BUG FIXES" section entries specific to "module1".
| | |__ 745-rename.md - An entry in the "BUG FIXES" section under "module1".
| |__ features/ - "FEATURES" section entries.
| |
| |__ summary.md - A summary of the next release.
|
|__ v0.1.0/ - Changes released historically in v0.1.0.
| |__ breaking-changes/ - "BREAKING CHANGES" section entries for v0.1.0.
| | |__ 467-api.md - An entry in the "BREAKING CHANGES" section for v0.1.0.
| | |__ 479-rpc.md - Another entry in the "BREAKING CHANGES" section for v0.1.0.
| |
| |__ bug-fixes/ - "BUG FIXES" section entries for v0.1.0.
| |
| |__ summary.md - A summary of release v0.1.0.
|
|__ epilogue.md - Any content to be added to the end of the generated CHANGELOG.
For a more detailed example, see the tests/full
folder for
the primary integration test that uses the most features/functionality. The
file tests/full/expected.md
is the expected
output when building the files in tests/full
.
```bash
unclog -h ```
```bash
unclog init
unclog init -e CHANGELOG.md
config.toml
file for your changelog, inferring asunclog init -g ```
There are two ways of adding a new entry:
$EDITOR
To add an entry entirely through the CLI:
```bash
echo 'project_url = "https://github.com/org/project"' >> .changelog/config.toml
config.toml
file.unclog add --id some-new-feature \ --issue 23 \ --section breaking-changes \ --message "Some new feature"
unclog add -i some-new-feature \ -n 23 \ -s breaking-changes \ -m "Some new feature"
unclog add -i some-new-feature \ -n 23 \ -c submodule \ -s breaking-changes \ -m "Some new feature" ```
To add an entry with your favourite $EDITOR
:
```bash
#
#
unclog add --section features --id 23-some-new-feature
unclog add -s breaking-changes -i 24-break-the-api ```
The format of an entry is currently recommended as the following (in Markdown):
markdown
- A user-oriented description of the change ([#123](https://github.com/someone/someproject/issues/123))
The #123
and its corresponding link is ideally a link to the issue being
resolved. If there's no issue, then reference the PR.
```bash
unclog build
unclog build --unreleased-only unclog build -u
unclog build --all unclog build -a
unclog build > CHANGELOG.md
.changelog
unclog -v build
unclog --help ```
```bash
unclog release v0.2.0 ```
If your project has components or submodules to it, referencing them when creating changelog entries allows you to group entries for one component together. For example:
bash
unclog add -i some-new-feature \
-n 23 \
-c submodule \
-s breaking-changes \
-m "Some *new* feature"
would result in an entry being created in
.changelog/unreleased/submodule/breaking-changes/23-some-new-feature.md
which,
when rendered, would look like:
markdown
- [submodule](./submodule)
- Some *new* feature ([#23](https://github.com/org/project/issues/23))
NB: As of v0.5.0, you must first define your components in your configuration
file (see below) prior to attempting to add an entry that references any of your
components. Otherwise unclog
will fail. This is to ensure that people don't
add entries for incorrectly named or non-existent components.
Certain unclog
settings can be overridden through the use of a configuration
file in .changelog/config.toml
. The following TOML shows all of the defaults
for the configuration. If you don't have a .changelog/config.toml
file, all of
the defaults will be assumed.
```toml
#
project_url = "https://github.com/org/project"
#
.changelog
folder. If thischange_template = "change-template.md"
wrap = 80
heading = "# CHANGELOG"
bullet_style = "-"
empty_msg = "Nothing to see here! Add some entries to get started."
.changelog
directory) to use as anepilogue_filename = "epilogue.md"
[unreleased]
.changelog
folder.folder = "unreleased"
heading = "## Unreleased"
[change_sets]
.changelog/unreleased/breaking-changes/summary.md
).summary_filename = "summary.md"
entry_ext = "md"
[components]
generalentriestitle = "General"
entry_indent = 2
# The components themselves. Each component has a name (used when rendered
# to Markdown) and a path relative to the project folder (i.e. relative to
# the parent of the `.changelog` folder).
[components.all]
component1 = { name = "Component 1", path = "component1" }
docs = { name = "Documentation", path = "docs" }
```
By default, the cli
feature is enabled, which builds the CLI. To use unclog
as a library instead without the CLI:
toml
[dependencies]
unclog = { version = "0.6", default-features = false }
Copyright © 2021- Informal Systems and contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files in this repository except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.