2019-08-11 07:24:03 +00:00
|
|
|
# Changelog Update
|
|
|
|
|
|
|
|
If you want to help with updating the [changelog][changelog], you're in the right place.
|
|
|
|
|
|
|
|
## When to update
|
|
|
|
|
2019-08-12 17:19:46 +00:00
|
|
|
Typos and other small fixes/additions are _always_ welcome.
|
|
|
|
|
|
|
|
Special care needs to be taken when it comes to updating the changelog for a new
|
|
|
|
Rust release. For that purpose, the changelog is ideally updated during the week
|
|
|
|
before an upcoming stable release. You can find the release dates on the [Rust
|
|
|
|
Forge][forge].
|
2019-08-11 07:24:03 +00:00
|
|
|
|
|
|
|
Most of the time we only need to update the changelog for minor Rust releases. It's
|
|
|
|
been very rare that Clippy changes were included in a patch release.
|
|
|
|
|
2020-04-20 18:39:49 +00:00
|
|
|
## Changelog update walkthrough
|
2019-08-11 07:24:03 +00:00
|
|
|
|
|
|
|
### 1. Finding the relevant Clippy commits
|
|
|
|
|
2020-06-05 12:47:12 +00:00
|
|
|
Each Rust release ships with its own version of Clippy. The Clippy subtree can
|
2020-04-20 18:39:49 +00:00
|
|
|
be found in the `tools` directory of the Rust repository.
|
2019-08-11 07:24:03 +00:00
|
|
|
|
2020-04-20 18:39:49 +00:00
|
|
|
Depending on the current time and what exactly you want to update, the following
|
|
|
|
bullet points might be helpful:
|
2019-08-11 07:24:03 +00:00
|
|
|
|
2020-04-20 18:39:49 +00:00
|
|
|
* When writing the release notes for the **upcoming stable release** you need to check
|
|
|
|
out the Clippy commit of the current Rust `beta` branch. [Link][rust_beta_tools]
|
|
|
|
* When writing the release notes for the **upcoming beta release**, you need to check
|
|
|
|
out the Clippy commit of the current Rust `master`. [Link][rust_master_tools]
|
|
|
|
* When writing the (forgotten) release notes for a **past stable release**, you
|
2020-11-19 10:23:59 +00:00
|
|
|
need to check out the Rust release tag of the stable release.
|
|
|
|
[Link][rust_stable_tools]
|
|
|
|
|
|
|
|
Usually you want to wirte the changelog of the **upcoming stable release**. Make
|
|
|
|
sure though, that `beta` was already branched in the Rust repository.
|
2020-04-20 18:39:49 +00:00
|
|
|
|
2020-06-02 18:45:57 +00:00
|
|
|
To find the commit hash, issue the following command when in a `rust-lang/rust` checkout:
|
|
|
|
```
|
|
|
|
git log --oneline -- src/tools/clippy/ | grep -o "Merge commit '[a-f0-9]*' into .*" | head -1 | sed -e "s/Merge commit '\([a-f0-9]*\)' into .*/\1/g"
|
|
|
|
```
|
2019-08-21 05:23:48 +00:00
|
|
|
|
2019-08-11 07:24:03 +00:00
|
|
|
### 2. Fetching the PRs between those commits
|
|
|
|
|
2020-04-20 18:39:49 +00:00
|
|
|
Once you've got the correct commit range, run
|
2019-08-11 07:24:03 +00:00
|
|
|
|
2020-04-20 18:39:49 +00:00
|
|
|
util/fetch_prs_between.sh commit1 commit2 > changes.txt
|
|
|
|
|
|
|
|
and open that file in your editor of choice.
|
2019-08-11 07:24:03 +00:00
|
|
|
|
|
|
|
When updating the changelog it's also a good idea to make sure that `commit1` is
|
|
|
|
already correct in the current changelog.
|
|
|
|
|
|
|
|
### 3. Authoring the final changelog
|
|
|
|
|
|
|
|
The above script should have dumped all the relevant PRs to the file you
|
|
|
|
specified. It should have filtered out most of the irrelevant PRs
|
|
|
|
already, but it's a good idea to do a manual cleanup pass where you look for
|
|
|
|
more irrelevant PRs. If you're not sure about some PRs, just leave them in for
|
|
|
|
the review and ask for feedback.
|
|
|
|
|
2019-08-12 17:19:46 +00:00
|
|
|
With the PRs filtered, you can start to take each PR and move the
|
2019-08-11 07:24:03 +00:00
|
|
|
`changelog: ` content to `CHANGELOG.md`. Adapt the wording as you see fit but
|
|
|
|
try to keep it somewhat coherent.
|
|
|
|
|
|
|
|
The order should roughly be:
|
|
|
|
|
|
|
|
1. New lints
|
2020-03-12 20:02:08 +00:00
|
|
|
2. Moves or deprecations of lints
|
|
|
|
3. Changes that expand what code existing lints cover
|
2019-08-11 07:24:03 +00:00
|
|
|
4. False positive fixes
|
|
|
|
5. Suggestion fixes/improvements
|
2020-03-12 20:02:08 +00:00
|
|
|
6. ICE fixes
|
|
|
|
7. Documentation improvements
|
|
|
|
8. Others
|
2019-08-11 07:24:03 +00:00
|
|
|
|
2020-11-19 10:23:59 +00:00
|
|
|
As section headers, we use:
|
|
|
|
|
|
|
|
```
|
|
|
|
### New Lints
|
|
|
|
### Moves and Deprecations
|
|
|
|
### Enhancements
|
|
|
|
### False Positive Fixes
|
|
|
|
### Suggestion Fixes/Improvements
|
|
|
|
### ICE Fixes
|
|
|
|
### Documentation Improvements
|
|
|
|
### Others
|
|
|
|
```
|
|
|
|
|
2019-08-12 17:19:46 +00:00
|
|
|
Please also be sure to update the Beta/Unreleased sections at the top with the
|
|
|
|
relevant commit ranges.
|
|
|
|
|
2019-08-11 07:24:03 +00:00
|
|
|
[changelog]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md
|
|
|
|
[forge]: https://forge.rust-lang.org/
|
2020-06-01 07:26:40 +00:00
|
|
|
[rust_master_tools]: https://github.com/rust-lang/rust/tree/master/src/tools/clippy
|
|
|
|
[rust_beta_tools]: https://github.com/rust-lang/rust/tree/beta/src/tools/clippy
|
2020-11-19 10:23:59 +00:00
|
|
|
[rust_stable_tools]: https://github.com/rust-lang/rust/releases
|