Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3d09849

Browse files
xFrednetflip1995
authored andcommitted
Print cargo dev help on missing arg and updated setup documentation
1 parent 41bc0f4 commit 3d09849

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ To work around this, you need to have a copy of the [rustc-repo][rustc_repo] ava
115115
`git clone https://github.com/rust-lang/rust/`.
116116
Then you can run a `cargo dev` command to automatically make Clippy use the rustc-repo via path-dependencies
117117
which `IntelliJ Rust` will be able to understand.
118-
Run `cargo dev ide_setup --repo-path <repo-path>` where `<repo-path>` is a path to the rustc repo
118+
Run `cargo dev setup intellij --repo-path <repo-path>` where `<repo-path>` is a path to the rustc repo
119119
you just cloned.
120120
The command will add path-dependencies pointing towards rustc-crates inside the rustc repo to
121121
Clippys `Cargo.toml`s and should allow `IntelliJ Rust` to understand most of the types that Clippy uses.

clippy_dev/src/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub fn run(check: bool, verbose: bool) {
8686
},
8787
CliError::RaSetupActive => {
8888
eprintln!(
89-
"error: a local rustc repo is enabled as path dependency via `cargo dev ide_setup`.
89+
"error: a local rustc repo is enabled as path dependency via `cargo dev setup intellij`.
9090
Not formatting because that would format the local repo as well!
9191
Please revert the changes to Cargo.tomls first."
9292
);

clippy_dev/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// warn on lints, that are included in `rust-lang/rust`s bootstrap
33
#![warn(rust_2018_idioms, unused_lifetimes)]
44

5-
use clap::{App, Arg, ArgMatches, SubCommand};
5+
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
66
use clippy_dev::{bless, fmt, new_lint, serve, setup, stderr_length_check, update_lints};
77
fn main() {
88
let matches = get_clap_config();
@@ -52,6 +52,7 @@ fn main() {
5252

5353
fn get_clap_config<'a>() -> ArgMatches<'a> {
5454
App::new("Clippy developer tooling")
55+
.setting(AppSettings::ArgRequiredElseHelp)
5556
.subcommand(
5657
SubCommand::with_name("bless")
5758
.about("bless the test output changes")
@@ -146,6 +147,7 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
146147
.subcommand(
147148
SubCommand::with_name("setup")
148149
.about("Support for setting up your personal development environment")
150+
.setting(AppSettings::ArgRequiredElseHelp)
149151
.subcommand(
150152
SubCommand::with_name("intellij")
151153
.about("Alter dependencies so Intellij Rust can find rustc internals")

clippy_dev/src/setup/intellij.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn inject_deps_into_manifest(
5555
// do not inject deps if we have aleady done so
5656
if cargo_toml.contains("[target.'cfg(NOT_A_PLATFORM)'.dependencies]") {
5757
eprintln!(
58-
"cargo dev ide_setup: warning: deps already found inside {}, doing nothing.",
58+
"cargo dev setup intellij: warning: deps already found inside {}, doing nothing.",
5959
manifest_path
6060
);
6161
return Ok(());

doc/basics.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ cargo dev fmt
9090
cargo dev update_lints
9191
# create a new lint and register it
9292
cargo dev new_lint
93+
# automatically formatting all code before each commit
94+
cargo dev setup git-hook
9395
# (experimental) Setup Clippy to work with IntelliJ-Rust
94-
cargo dev ide_setup
96+
cargo dev setup intellij
9597
```
9698

9799
## lintcheck

0 commit comments

Comments
 (0)