1
Fork 0

cargo dev: rename ra-setup to ra_setup to be in line with the other commands

This commit is contained in:
Matthias Krüger 2020-12-13 17:01:44 +01:00
parent 91fa25c9de
commit 27dc565d28
5 changed files with 10 additions and 10 deletions

View file

@ -19,10 +19,10 @@ All contributors are expected to follow the [Rust Code of Conduct].
- [Writing code](#writing-code) - [Writing code](#writing-code)
- [Getting code-completion for rustc internals to work](#getting-code-completion-for-rustc-internals-to-work) - [Getting code-completion for rustc internals to work](#getting-code-completion-for-rustc-internals-to-work)
- [How Clippy works](#how-clippy-works) - [How Clippy works](#how-clippy-works)
- [Fixing build failures caused by Rust](#fixing-build-failures-caused-by-rust) - [Syncing changes between Clippy and [`rust-lang/rust`]](#syncing-changes-between-clippy-and-rust-langrust)
- [Patching git-subtree to work with big repos](#patching-git-subtree-to-work-with-big-repos) - [Patching git-subtree to work with big repos](#patching-git-subtree-to-work-with-big-repos)
- [Performing the sync](#performing-the-sync) - [Performing the sync from [`rust-lang/rust`] to Clippy](#performing-the-sync-from-rust-langrust-to-clippy)
- [Syncing back changes in Clippy to [`rust-lang/rust`]](#syncing-back-changes-in-clippy-to-rust-langrust) - [Performing the sync from Clippy to [`rust-lang/rust`]](#performing-the-sync-from-clippy-to-rust-langrust)
- [Defining remotes](#defining-remotes) - [Defining remotes](#defining-remotes)
- [Issue and PR triage](#issue-and-pr-triage) - [Issue and PR triage](#issue-and-pr-triage)
- [Bors and Homu](#bors-and-homu) - [Bors and Homu](#bors-and-homu)
@ -111,7 +111,7 @@ To work around this, you need to have a copy of the [rustc-repo][rustc_repo] ava
`git clone https://github.com/rust-lang/rust/`. `git clone https://github.com/rust-lang/rust/`.
Then you can run a `cargo dev` command to automatically make Clippy use the rustc-repo via path-dependencies Then you can run a `cargo dev` command to automatically make Clippy use the rustc-repo via path-dependencies
which rust-analyzer will be able to understand. which rust-analyzer will be able to understand.
Run `cargo dev ra-setup --repo-path <repo-path>` where `<repo-path>` is an absolute path to the rustc repo Run `cargo dev ra_setup --repo-path <repo-path>` where `<repo-path>` is an absolute path to the rustc repo
you just cloned. you just cloned.
The command will add path-dependencies pointing towards rustc-crates inside the rustc repo to The command will add path-dependencies pointing towards rustc-crates inside the rustc repo to
Clippys `Cargo.toml`s and should allow rust-analyzer to understand most of the types that Clippy uses. Clippys `Cargo.toml`s and should allow rust-analyzer to understand most of the types that Clippy uses.

View file

@ -89,7 +89,7 @@ pub fn run(check: bool, verbose: bool) {
}, },
CliError::RaSetupActive => { CliError::RaSetupActive => {
eprintln!( eprintln!(
"error: a local rustc repo is enabled as path dependency via `cargo dev ra-setup`. "error: a local rustc repo is enabled as path dependency via `cargo dev ra_setup`.
Not formatting because that would format the local repo as well! Not formatting because that would format the local repo as well!
Please revert the changes to Cargo.tomls first." Please revert the changes to Cargo.tomls first."
); );

View file

@ -35,7 +35,7 @@ fn main() {
("limit_stderr_length", _) => { ("limit_stderr_length", _) => {
stderr_length_check::check(); stderr_length_check::check();
}, },
("ra-setup", Some(matches)) => ra_setup::run(matches.value_of("rustc-repo-path")), ("ra_setup", Some(matches)) => ra_setup::run(matches.value_of("rustc-repo-path")),
("serve", Some(matches)) => { ("serve", Some(matches)) => {
let port = matches.value_of("port").unwrap().parse().unwrap(); let port = matches.value_of("port").unwrap().parse().unwrap();
let lint = matches.value_of("lint"); let lint = matches.value_of("lint");
@ -131,7 +131,7 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
.about("Ensures that stderr files do not grow longer than a certain amount of lines."), .about("Ensures that stderr files do not grow longer than a certain amount of lines."),
) )
.subcommand( .subcommand(
SubCommand::with_name("ra-setup") SubCommand::with_name("ra_setup")
.about("Alter dependencies so rust-analyzer can find rustc internals") .about("Alter dependencies so rust-analyzer can find rustc internals")
.arg( .arg(
Arg::with_name("rustc-repo-path") Arg::with_name("rustc-repo-path")

View file

@ -52,7 +52,7 @@ fn inject_deps_into_manifest(
// do not inject deps if we have aleady done so // do not inject deps if we have aleady done so
if cargo_toml.contains("[target.'cfg(NOT_A_PLATFORM)'.dependencies]") { if cargo_toml.contains("[target.'cfg(NOT_A_PLATFORM)'.dependencies]") {
eprintln!( eprintln!(
"cargo dev ra-setup: warning: deps already found inside {}, doing nothing.", "cargo dev ra_setup: warning: deps already found inside {}, doing nothing.",
manifest_path manifest_path
); );
return Ok(()); return Ok(());

View file

@ -8,7 +8,7 @@ the codebase take a look at [Adding Lints] or [Common Tools].
[Common Tools]: https://github.com/rust-lang/rust-clippy/blob/master/doc/common_tools_writing_lints.md [Common Tools]: https://github.com/rust-lang/rust-clippy/blob/master/doc/common_tools_writing_lints.md
- [Basics for hacking on Clippy](#basics-for-hacking-on-clippy) - [Basics for hacking on Clippy](#basics-for-hacking-on-clippy)
- [Get the code](#get-the-code) - [Get the Code](#get-the-code)
- [Building and Testing](#building-and-testing) - [Building and Testing](#building-and-testing)
- [`cargo dev`](#cargo-dev) - [`cargo dev`](#cargo-dev)
- [PR](#pr) - [PR](#pr)
@ -87,7 +87,7 @@ cargo dev update_lints
# create a new lint and register it # create a new lint and register it
cargo dev new_lint cargo dev new_lint
# (experimental) Setup Clippy to work with rust-analyzer # (experimental) Setup Clippy to work with rust-analyzer
cargo dev ra-setup cargo dev ra_setup
``` ```
## PR ## PR