Skip to content

Commit 8d24fac

Browse files
committed
docs: Explain how to update the changelog
1 parent ea26a95 commit 8d24fac

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
22

33
All notable changes to this project will be documented in this file.
4+
See [Changelog Update](doc/changelog_update.md) if you want to update this
5+
document.
46

57
## Unreleased / In Rust Beta or Nightly
68

doc/changelog_update.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Changelog Update
2+
3+
If you want to help with updating the [changelog][changelog], you're in the right place.
4+
5+
## When to update
6+
7+
The changelog is ideally updated during the week before an upcoming stable
8+
release. Typos and other small fixes/additions are always welcome. You can find
9+
the release dates on the [Rust Forge][forge].
10+
11+
Most of the time we only need to update the changelog for minor Rust releases. It's
12+
been very rare that Clippy changes were included in a patch release.
13+
14+
## How to update
15+
16+
### 1. Finding the relevant Clippy commits
17+
18+
Each Rust release ships with its own version of Clippy. The Clippy submodule can
19+
be found in the [tools][tools] directory of the Rust repository.
20+
21+
To find the Clippy commit hash for a specific Rust release you select the Rust
22+
release tag from the dropdown and then check the commit of the Clippy directory:
23+
24+
TODO: Include screenshot
25+
26+
### 2. Fetching the PRs between those commits
27+
28+
You'll want to run `util/fetch_prs_between.sh commit1 commit2 > changes.txt`
29+
and open that file in your editor of choice.
30+
31+
* `commit1` is the Clippy commit hash of the previous stable release
32+
* `commit2` is the Clippy commit hash of the release you want to write the changelog for.
33+
34+
When updating the changelog it's also a good idea to make sure that `commit1` is
35+
already correct in the current changelog.
36+
37+
### 3. Authoring the final changelog
38+
39+
The above script should have dumped all the relevant PRs to the file you
40+
specified. It should have filtered out most of the irrelevant PRs
41+
already, but it's a good idea to do a manual cleanup pass where you look for
42+
more irrelevant PRs. If you're not sure about some PRs, just leave them in for
43+
the review and ask for feedback.
44+
45+
With PRs filtered, you can start to take each PR and move the
46+
`changelog: ` content to `CHANGELOG.md`. Adapt the wording as you see fit but
47+
try to keep it somewhat coherent.
48+
49+
The order should roughly be:
50+
51+
1. New lints
52+
2. Changes that expand what code existing lints cover
53+
3. ICE fixes
54+
4. False positive fixes
55+
5. Suggestion fixes/improvements
56+
57+
[changelog]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md
58+
[forge]: https://forge.rust-lang.org/
59+
[tools]: https://github.com/rust-lang/rust/tree/master/src/tools

0 commit comments

Comments
 (0)