@@ -21,11 +21,6 @@ All contributors are expected to follow the [Rust Code of Conduct].
2121 - [ IntelliJ Rust] ( #intellij-rust )
2222 - [ Rust Analyzer] ( #rust-analyzer )
2323 - [ How Clippy works] ( #how-clippy-works )
24- - [ Syncing changes between Clippy and ` rust-lang/rust ` ] ( #syncing-changes-between-clippy-and-rust-langrust )
25- - [ Patching git-subtree to work with big repos] ( #patching-git-subtree-to-work-with-big-repos )
26- - [ Performing the sync from ` rust-lang/rust ` to Clippy] ( #performing-the-sync-from-rust-langrust-to-clippy )
27- - [ Performing the sync from Clippy to ` rust-lang/rust ` ] ( #performing-the-sync-from-clippy-to-rust-langrust )
28- - [ Defining remotes] ( #defining-remotes )
2924 - [ Issue and PR triage] ( #issue-and-pr-triage )
3025 - [ Bors and Homu] ( #bors-and-homu )
3126 - [ Contributions] ( #contributions )
@@ -205,126 +200,6 @@ That's why the `else_if_without_else` example uses the `register_early_pass` fun
205200[ early_lint_pass ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html
206201[ late_lint_pass ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.LateLintPass.html
207202
208- ## Syncing changes between Clippy and [ ` rust-lang/rust ` ]
209-
210- Clippy currently gets built with a pinned nightly version.
211-
212- In the ` rust-lang/rust ` repository, where rustc resides, there's a copy of Clippy
213- that compiler hackers modify from time to time to adapt to changes in the unstable
214- API of the compiler.
215-
216- We need to sync these changes back to this repository periodically, and the changes
217- made to this repository in the meantime also need to be synced to the ` rust-lang/rust ` repository.
218-
219- To avoid flooding the ` rust-lang/rust ` PR queue, this two-way sync process is done
220- in a bi-weekly basis if there's no urgent changes. This is done starting on the day of
221- the Rust stable release and then every other week. That way we guarantee that we keep
222- this repo up to date with the latest compiler API, and every feature in Clippy is available
223- for 2 weeks in nightly, before it can get to beta. For reference, the first sync
224- following this cadence was performed the 2020-08-27.
225-
226- This process is described in detail in the following sections. For general information
227- about ` subtree ` s in the Rust repository see [ Rust's ` CONTRIBUTING.md ` ] [ subtree ] .
228-
229- ### Patching git-subtree to work with big repos
230-
231- Currently, there's a bug in ` git-subtree ` that prevents it from working properly
232- with the [ ` rust-lang/rust ` ] repo. There's an open PR to fix that, but it's stale.
233- Before continuing with the following steps, we need to manually apply that fix to
234- our local copy of ` git-subtree ` .
235-
236- You can get the patched version of ` git-subtree ` from [ here] [ gitgitgadget-pr ] .
237- Put this file under ` /usr/lib/git-core ` (taking a backup of the previous file)
238- and make sure it has the proper permissions:
239-
240- ``` bash
241- sudo cp --backup /path/to/patched/git-subtree.sh /usr/lib/git-core/git-subtree
242- sudo chmod --reference=/usr/lib/git-core/git-subtree~ /usr/lib/git-core/git-subtree
243- sudo chown --reference=/usr/lib/git-core/git-subtree~ /usr/lib/git-core/git-subtree
244- ```
245-
246- _ Note:_ The first time running ` git subtree push ` a cache has to be built. This
247- involves going through the complete Clippy history once. For this you have to
248- increase the stack limit though, which you can do with ` ulimit -s 60000 ` .
249- Make sure to run the ` ulimit ` command from the same session you call git subtree.
250-
251- _ Note:_ If you are a Debian user, ` dash ` is the shell used by default for scripts instead of ` sh ` .
252- This shell has a hardcoded recursion limit set to 1000. In order to make this process work,
253- you need to force the script to run ` bash ` instead. You can do this by editing the first
254- line of the ` git-subtree ` script and changing ` sh ` to ` bash ` .
255-
256- ### Performing the sync from [ ` rust-lang/rust ` ] to Clippy
257-
258- Here is a TL;DR version of the sync process (all of the following commands have
259- to be run inside the ` rust ` directory):
260-
261- 1 . Clone the [ ` rust-lang/rust ` ] repository or make sure it is up to date.
262- 2 . Checkout the commit from the latest available nightly. You can get it using ` rustup check ` .
263- 3 . Sync the changes to the rust-copy of Clippy to your Clippy fork:
264- ``` bash
265- # Make sure to change `your-github-name` to your github name in the following command. Also be
266- # sure to either use a net-new branch, e.g. `sync-from-rust`, or delete the branch beforehand
267- # because changes cannot be fast forwarded
268- git subtree push -P src/tools/clippy
[email protected] :your-github-name/rust-clippy sync-from-rust
269- ```
270-
271- _Note:_ This will directly push to the remote repository. You can also push
272- to your local copy by replacing the remote address with ` /path/to/rust-clippy`
273- directory.
274-
275- _Note:_ Most of the time you have to create a merge commit in the
276- ` rust-clippy` repo (this has to be done in the Clippy repo, not in the
277- rust-copy of Clippy):
278- ` ` ` bash
279- git fetch origin && git fetch upstream
280- git checkout sync-from-rust
281- git merge upstream/master
282- ` ` `
283- 4. Open a PR to ` rust-lang/rust-clippy` and wait for it to get merged (to
284- accelerate the process ping the ` @rust-lang/clippy` team in your PR and/or
285- ~ ~annoy~~ ask them in the [Zulip] stream.)
286-
287- # ## Performing the sync from Clippy to [`rust-lang/rust`]
288-
289- All of the following commands have to be run inside the ` rust` directory.
290-
291- 1. Make sure Clippy itself is up-to-date by following the steps outlined in the previous
292- section if necessary.
293-
294- 2. Sync the ` rust-lang/rust-clippy` master to the rust-copy of Clippy:
295- ` ` ` bash
296- git checkout -b sync-from-clippy
297- git subtree pull -P src/tools/clippy https://github.com/rust-lang/rust-clippy master
298- ` ` `
299- 3. Open a PR to [` rust-lang/rust` ]
300-
301- # ## Defining remotes
302-
303- You may want to define remotes, so you don' t have to type out the remote
304- addresses on every sync. You can do this with the following commands (these
305- commands still have to be run inside the `rust` directory):
306-
307- ```bash
308- # Set clippy-upstream remote for pulls
309- $ git remote add clippy-upstream https://github.com/rust-lang/rust-clippy
310- # Make sure to not push to the upstream repo
311- $ git remote set-url --push clippy-upstream DISABLED
312- # Set clippy-origin remote to your fork for pushes
313- $ git remote add clippy-origin [email protected] :your-github-name/rust-clippy 314- # Set a local remote
315- $ git remote add clippy-local /path/to/rust-clippy
316- ```
317-
318- You can then sync with the remote names from above, e.g.:
319-
320- ```bash
321- $ git subtree push -P src/tools/clippy clippy-local sync-from-rust
322- ```
323-
324- [gitgitgadget-pr]: https://github.com/gitgitgadget/git/pull/493
325- [subtree]: https://rustc-dev-guide.rust-lang.org/contributing.html#external-dependencies-subtree
326- [`rust-lang/rust`]: https://github.com/rust-lang/rust
327-
328203## Issue and PR triage
329204
330205Clippy is following the [ Rust triage procedure] [ triage ] for issues and pull
0 commit comments