Skip to content

Commit 7f319c7

Browse files
authored
Rollup merge of #83012 - flip1995:clippyup, r=Manishearth
Update Clippy Bi-weekly Clippy sync. r? ``@Manishearth``
2 parents fa3f186 + 99d0519 commit 7f319c7

File tree

298 files changed

+15612
-12460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+15612
-12460
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ dependencies = [
570570
"clippy_lints",
571571
"compiletest_rs 0.6.0",
572572
"derive-new",
573+
"regex",
573574
"rustc-workspace-hack",
574575
"rustc_tools_util 0.2.0",
575576
"semver 0.11.0",

src/tools/clippy/.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[alias]
22
uitest = "test --test compile-test"
33
dev = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
4-
dev-lintcheck = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features lintcheck -- lintcheck"
4+
lintcheck = "run --target-dir lintcheck/target --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
55

66
[build]
77
rustflags = ["-Zunstable-options"]

src/tools/clippy/.github/workflows/clippy.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ env:
2727

2828
jobs:
2929
base:
30+
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
3031
runs-on: ubuntu-latest
3132

3233
steps:
@@ -50,11 +51,16 @@ jobs:
5051
- name: Build
5152
run: cargo build --features deny-warnings,internal-lints
5253

53-
- name: Test "--fix -Zunstable-options"
54-
run: cargo run --features deny-warnings,internal-lints --bin cargo-clippy -- clippy --fix -Zunstable-options
54+
- name: Test
55+
run: cargo test --features deny-warnings,internal-lints
5556

56-
- name: Test Workspace
57-
run: cargo test --all --features deny-warnings,internal-lints
57+
- name: Test clippy_lints
58+
run: cargo test --features deny-warnings,internal-lints
59+
working-directory: clippy_lints
60+
61+
- name: Test rustc_tools_util
62+
run: cargo test --features deny-warnings
63+
working-directory: rustc_tools_util
5864

5965
- name: Test clippy_dev
6066
run: cargo test --features deny-warnings
@@ -64,6 +70,10 @@ jobs:
6470
run: ../target/debug/cargo-clippy
6571
working-directory: clippy_workspace_tests
6672

73+
- name: Test cargo-clippy --fix
74+
run: ../target/debug/cargo-clippy clippy --fix -Zunstable-options
75+
working-directory: clippy_workspace_tests
76+
6777
- name: Test clippy-driver
6878
run: bash .github/driver.sh
6979
env:

src/tools/clippy/.github/workflows/clippy_bors.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272

7373
runs-on: ${{ matrix.os }}
7474

75+
# NOTE: If you modify this job, make sure you copy the changes to clippy.yml
7576
steps:
7677
# Setup
7778
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
@@ -112,8 +113,16 @@ jobs:
112113
- name: Build
113114
run: cargo build --features deny-warnings,internal-lints
114115

115-
- name: Test Workspace
116-
run: cargo test --all --features deny-warnings,internal-lints
116+
- name: Test
117+
run: cargo test --features deny-warnings,internal-lints
118+
119+
- name: Test clippy_lints
120+
run: cargo test --features deny-warnings,internal-lints
121+
working-directory: clippy_lints
122+
123+
- name: Test rustc_tools_util
124+
run: cargo test --features deny-warnings
125+
working-directory: rustc_tools_util
117126

118127
- name: Test clippy_dev
119128
run: cargo test --features deny-warnings
@@ -123,11 +132,22 @@ jobs:
123132
run: ../target/debug/cargo-clippy
124133
working-directory: clippy_workspace_tests
125134

135+
- name: Test cargo-clippy --fix
136+
run: ../target/debug/cargo-clippy clippy --fix -Zunstable-options
137+
working-directory: clippy_workspace_tests
138+
126139
- name: Test clippy-driver
127140
run: bash .github/driver.sh
128141
env:
129142
OS: ${{ runner.os }}
130143

144+
- name: Test cargo dev new lint
145+
run: |
146+
cargo dev new_lint --name new_early_pass --pass early
147+
cargo dev new_lint --name new_late_pass --pass late
148+
cargo check
149+
git reset --hard HEAD
150+
131151
integration_build:
132152
needs: changelog
133153
runs-on: ubuntu-latest

src/tools/clippy/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ out
2121
/clippy_utils/target
2222
/clippy_workspace_tests/target
2323
/clippy_dev/target
24+
/lintcheck/target
2425
/rustc_tools_util/target
2526

2627
# Generated by dogfood

src/tools/clippy/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,7 @@ Released 2018-09-13
21042104
[`if_not_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
21052105
[`if_same_then_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
21062106
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
2107+
[`implicit_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
21072108
[`implicit_hasher`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher
21082109
[`implicit_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
21092110
[`implicit_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
@@ -2134,6 +2135,7 @@ Released 2018-09-13
21342135
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
21352136
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
21362137
[`iter_cloned_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect
2138+
[`iter_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_count
21372139
[`iter_next_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_loop
21382140
[`iter_next_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice
21392141
[`iter_nth`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth

src/tools/clippy/Cargo.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
[package]
22
name = "clippy"
33
version = "0.1.52"
4-
authors = [
5-
"Manish Goregaokar <manishsmail@gmail.com>",
6-
"Andre Bogus <bogusandre@gmail.com>",
7-
"Georg Brandl <georg@python.org>",
8-
"Martin Carton <cartonmartin@gmail.com>",
9-
"Oliver Schneider <clippy-iethah7aipeen8neex1a@oli-obk.de>"
10-
]
4+
authors = ["The Rust Clippy Developers"]
115
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
126
repository = "https://github.com/rust-lang/rust-clippy"
137
readme = "README.md"
@@ -42,6 +36,7 @@ tester = "0.9"
4236
clippy-mini-macro-test = { version = "0.2", path = "mini-macro" }
4337
serde = { version = "1.0", features = ["derive"] }
4438
derive-new = "0.5"
39+
regex = "1.4"
4540

4641
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
4742
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
@@ -55,3 +50,7 @@ rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
5550
deny-warnings = []
5651
integration = ["tempfile"]
5752
internal-lints = ["clippy_lints/internal-lints"]
53+
54+
[package.metadata.rust-analyzer]
55+
# This package uses #[feature(rustc_private)]
56+
rustc_private = true

src/tools/clippy/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ the lint(s) you are interested in:
202202
```terminal
203203
cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
204204
```
205-
Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`.
206205

207206
### Specifying the minimum supported Rust version
208207

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
[package]
22
name = "clippy_dev"
33
version = "0.0.1"
4-
authors = ["Philipp Hansch <dev@phansch.net>"]
4+
authors = ["The Rust Clippy Developers"]
55
edition = "2018"
66

7-
87
[dependencies]
98
bytecount = "0.6"
109
clap = "2.33"
11-
flate2 = { version = "1.0.19", optional = true }
12-
fs_extra = { version = "1.2.0", optional = true }
1310
itertools = "0.9"
1411
opener = "0.4"
1512
regex = "1"
16-
serde = { version = "1.0", features = ["derive"], optional = true }
17-
serde_json = { version = "1.0", optional = true }
1813
shell-escape = "0.1"
19-
tar = { version = "0.4.30", optional = true }
20-
toml = { version = "0.5", optional = true }
21-
ureq = { version = "2.0.0-rc3", optional = true }
22-
rayon = { version = "1.5.0", optional = true }
2314
walkdir = "2"
2415

2516
[features]
26-
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde", "fs_extra", "rayon"]
2717
deny-warnings = []

src/tools/clippy/clippy_dev/src/fmt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub fn run(check: bool, verbose: bool) {
5454
success &= cargo_fmt(context, project_root.as_path())?;
5555
success &= cargo_fmt(context, &project_root.join("clippy_dev"))?;
5656
success &= cargo_fmt(context, &project_root.join("rustc_tools_util"))?;
57+
success &= cargo_fmt(context, &project_root.join("lintcheck"))?;
5758

5859
for entry in WalkDir::new(project_root.join("tests")) {
5960
let entry = entry?;

0 commit comments

Comments
 (0)