diff options
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r-- | xtask/src/main.rs | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 35cc7c108..915aae71a 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! See https://github.com/matklad/cargo-xtask/. | 1 | //! See https://github.com/matklad/cargo-xtask/. |
2 | //! | 2 | //! |
3 | //! This binary defines various auxiliary build commands, which are not | 3 | //! This binary defines various auxiliary build commands, which are not |
4 | //! expressible with just `cargo`. Notably, it provides `cargo xtask codegen` | 4 | //! expressible with just `cargo`. Notably, it provides tests via `cargo test -p xtask` |
5 | //! for code generation and `cargo xtask install` for installation of | 5 | //! for code generation and `cargo xtask install` for installation of |
6 | //! rust-analyzer server and client. | 6 | //! rust-analyzer server and client. |
7 | //! | 7 | //! |
@@ -40,7 +40,6 @@ fn main() -> Result<()> { | |||
40 | return Ok(()); | 40 | return Ok(()); |
41 | } | 41 | } |
42 | flags::XtaskCmd::Install(cmd) => cmd.run(), | 42 | flags::XtaskCmd::Install(cmd) => cmd.run(), |
43 | flags::XtaskCmd::Lint(_) => run_clippy(), | ||
44 | flags::XtaskCmd::FuzzTests(_) => run_fuzzer(), | 43 | flags::XtaskCmd::FuzzTests(_) => run_fuzzer(), |
45 | flags::XtaskCmd::PreCache(cmd) => cmd.run(), | 44 | flags::XtaskCmd::PreCache(cmd) => cmd.run(), |
46 | flags::XtaskCmd::Release(cmd) => cmd.run(), | 45 | flags::XtaskCmd::Release(cmd) => cmd.run(), |
@@ -95,25 +94,6 @@ fn ensure_rustfmt() -> Result<()> { | |||
95 | Ok(()) | 94 | Ok(()) |
96 | } | 95 | } |
97 | 96 | ||
98 | fn run_clippy() -> Result<()> { | ||
99 | if cmd!("cargo clippy --version").read().is_err() { | ||
100 | bail!( | ||
101 | "Failed run cargo clippy. \ | ||
102 | Please run `rustup component add clippy` to install it.", | ||
103 | ) | ||
104 | } | ||
105 | |||
106 | let allowed_lints = " | ||
107 | -A clippy::collapsible_if | ||
108 | -A clippy::needless_pass_by_value | ||
109 | -A clippy::nonminimal_bool | ||
110 | -A clippy::redundant_pattern_matching | ||
111 | " | ||
112 | .split_ascii_whitespace(); | ||
113 | cmd!("cargo clippy --all-features --all-targets -- {allowed_lints...}").run()?; | ||
114 | Ok(()) | ||
115 | } | ||
116 | |||
117 | fn run_fuzzer() -> Result<()> { | 97 | fn run_fuzzer() -> Result<()> { |
118 | let _d = pushd("./crates/syntax")?; | 98 | let _d = pushd("./crates/syntax")?; |
119 | let _e = pushenv("RUSTUP_TOOLCHAIN", "nightly"); | 99 | let _e = pushenv("RUSTUP_TOOLCHAIN", "nightly"); |