1 # Release a new Clippy Version
3 _NOTE: This document is probably only relevant to you, if you're a member of the
6 Clippy is released together with stable Rust releases. The dates for these
7 releases can be found at the [Rust Forge]. This document explains the necessary
8 steps to create a Clippy release.
10 1. [Remerge the `beta` branch](#remerge-the-beta-branch)
11 2. [Update the `beta` branch](#update-the-beta-branch)
12 3. [Find the Clippy commit](#find-the-clippy-commit)
13 4. [Tag the stable commit](#tag-the-stable-commit)
14 5. [Update `CHANGELOG.md`](#update-changelogmd)
16 _NOTE: This document is for stable Rust releases, not for point releases. For
17 point releases, step 1. and 2. should be enough._
19 [Rust Forge]: https://forge.rust-lang.org/
22 ## Remerge the `beta` branch
24 This step is only necessary, if since the last release something was backported
25 to the beta Rust release. The remerge is then necessary, to make sure that the
26 Clippy commit, that was used by the now stable Rust release, persists in the
27 tree of the Clippy repository.
29 To find out if this step is necessary run
32 # Assumes that the local master branch is up-to-date
34 $ git branch master --contains upstream/beta
37 If this command outputs `master`, this step is **not** necessary.
40 # Assuming `HEAD` is the current `master` branch of rust-lang/rust-clippy
41 $ git checkout -b backport_remerge
42 $ git merge upstream/beta
43 $ git diff # This diff has to be empty, otherwise something with the remerge failed
44 $ git push origin backport_remerge # This can be pushed to your fork
47 After this, open a PR to the master branch. In this PR, the commit hash of the
48 `HEAD` of the `beta` branch must exists. In addition to that, no files should
49 be changed by this PR.
52 ## Update the `beta` branch
54 This step must be done **after** the PR of the previous step was merged.
56 First, the Clippy commit of the `beta` branch of the Rust repository has to be
60 # Assuming the current directory corresponds to the Rust repository
62 $ git submodule update
63 $ BETA_SHA=$(git submodule status src/tools/clippy | awk '{print $1}')
66 After finding the Clippy commit, the `beta` branch in the Clippy repository can
70 # Assuming the current directory corresponds to the Clippy repository
72 $ git rebase $BETA_SHA
73 $ git push upstream beta
77 ## Find the Clippy commit
79 The first step is to tag the Clippy commit, that is included in the stable Rust
80 release. This commit can be found in the Rust repository.
83 # Assuming the current directory corresponds to the Rust repository
84 $ git fetch upstream # `upstream` is the `rust-lang/rust` remote
85 $ git checkout 1.XX.0 # XX should be exchanged with the corresponding version
86 $ git submodule update
87 $ SHA=$(git submodule status src/tools/clippy | awk '{print $1}')
91 ## Tag the stable commit
93 After finding the Clippy commit, it can be tagged with the release number.
96 # Assuming the current directory corresponds to the Clippy repository
98 $ git tag rust-1.XX.0 # XX should be exchanged with the corresponding version
99 $ git push upstream master --tags # `upstream` is the `rust-lang/rust-clippy` remote
102 After this, the release should be available on the Clippy [release page].
104 [release page]: https://github.com/rust-lang/rust-clippy/releases
107 ## Update `CHANGELOG.md`
109 For this see the document on [how to update the changelog].
111 [how to update the changelog]: https://github.com/rust-lang/rust-clippy/blob/master/doc/changelog_update.md