Skip to content

Commit 88c8dc6

Browse files
authored
Merge branch 'master' into tests
2 parents af268c8 + b86a202 commit 88c8dc6

File tree

625 files changed

+14131
-9374
lines changed

Some content is hidden

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

625 files changed

+14131
-9374
lines changed

.cargo/config.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[alias]
2+
bless = "test --config env.RUSTC_BLESS='1'"
23
uitest = "test --test compile-test"
3-
uibless = "test --test compile-test -- -- --bless"
4-
bless = "test -- -- --bless"
4+
uibless = "bless --test compile-test"
55
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
66
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
7-
collect-metadata = "test --test dogfood --features internal -- collect_metadata"
7+
collect-metadata = "test --test compile-test --config env.COLLECT_METADATA='1'"
88

99
[build]
1010
# -Zbinary-dep-depinfo allows us to track which rlib files to use for compiling UI tests
@@ -13,6 +13,13 @@ target-dir = "target"
1313

1414
[unstable]
1515
binary-dep-depinfo = true
16+
profile-rustflags = true
1617

1718
[profile.dev]
1819
split-debuginfo = "unpacked"
20+
21+
# Add back the containing directory of the packages we have to refer to using --manifest-path
22+
[profile.dev.package.clippy_dev]
23+
rustflags = ["--remap-path-prefix", "=clippy_dev"]
24+
[profile.dev.package.lintcheck]
25+
rustflags = ["--remap-path-prefix", "=lintcheck"]

.github/deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mkdir out/master/
1010
cp util/gh-pages/index.html out/master
1111
cp util/gh-pages/script.js out/master
1212
cp util/gh-pages/lints.json out/master
13+
cp util/gh-pages/style.css out/master
1314

1415
if [[ -n $TAG_NAME ]]; then
1516
echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"

.github/workflows/clippy.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ env:
2525
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
2626
NO_FMT_TEST: 1
2727
CARGO_INCREMENTAL: 0
28+
RUSTFLAGS: -D warnings
2829

2930
concurrency:
3031
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
@@ -47,25 +48,25 @@ jobs:
4748

4849
# Run
4950
- name: Build
50-
run: cargo build --tests --features deny-warnings,internal
51+
run: cargo build --tests --features internal
5152

5253
- name: Test
53-
run: cargo test --features deny-warnings,internal
54+
run: cargo test --features internal
5455

5556
- name: Test clippy_lints
56-
run: cargo test --features deny-warnings,internal
57+
run: cargo test --features internal
5758
working-directory: clippy_lints
5859

5960
- name: Test clippy_utils
60-
run: cargo test --features deny-warnings
61+
run: cargo test
6162
working-directory: clippy_utils
6263

6364
- name: Test rustc_tools_util
64-
run: cargo test --features deny-warnings
65+
run: cargo test
6566
working-directory: rustc_tools_util
6667

6768
- name: Test clippy_dev
68-
run: cargo test --features deny-warnings
69+
run: cargo test
6970
working-directory: clippy_dev
7071

7172
- name: Test clippy-driver

.github/workflows/clippy_bors.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
1212
NO_FMT_TEST: 1
1313
CARGO_INCREMENTAL: 0
14+
RUSTFLAGS: -D warnings
1415

1516
concurrency:
1617
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
@@ -85,34 +86,34 @@ jobs:
8586
8687
# Run
8788
- name: Build
88-
run: cargo build --tests --features deny-warnings,internal
89+
run: cargo build --tests --features internal
8990

9091
- name: Test
9192
if: matrix.host == 'x86_64-unknown-linux-gnu'
92-
run: cargo test --features deny-warnings,internal
93+
run: cargo test --features internal
9394

9495
- name: Test
9596
if: matrix.host != 'x86_64-unknown-linux-gnu'
96-
run: cargo test --features deny-warnings,internal -- --skip dogfood
97+
run: cargo test --features internal -- --skip dogfood
9798

9899
- name: Test clippy_lints
99-
run: cargo test --features deny-warnings,internal
100+
run: cargo test --features internal
100101
working-directory: clippy_lints
101102

102103
- name: Test clippy_utils
103-
run: cargo test --features deny-warnings
104+
run: cargo test
104105
working-directory: clippy_utils
105106

106107
- name: Test clippy_config
107-
run: cargo test --features deny-warnings
108+
run: cargo test
108109
working-directory: clippy_config
109110

110111
- name: Test rustc_tools_util
111-
run: cargo test --features deny-warnings
112+
run: cargo test
112113
working-directory: rustc_tools_util
113114

114115
- name: Test clippy_dev
115-
run: cargo test --features deny-warnings
116+
run: cargo test
116117
working-directory: clippy_dev
117118

118119
- name: Test clippy-driver
@@ -135,11 +136,6 @@ jobs:
135136
- name: Test metadata collection
136137
run: cargo collect-metadata
137138

138-
- name: Test lint_configuration.md is up-to-date
139-
run: |
140-
echo "run \`cargo collect-metadata\` if this fails"
141-
git update-index --refresh
142-
143139
integration_build:
144140
needs: changelog
145141
runs-on: ubuntu-latest

.github/workflows/clippy_dev.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
env:
1717
RUST_BACKTRACE: 1
1818
CARGO_INCREMENTAL: 0
19+
RUSTFLAGS: -D warnings
1920

2021
jobs:
2122
clippy_dev:
@@ -28,7 +29,7 @@ jobs:
2829

2930
# Run
3031
- name: Build
31-
run: cargo build --features deny-warnings
32+
run: cargo build
3233
working-directory: clippy_dev
3334

3435
- name: Test update_lints
@@ -38,6 +39,8 @@ jobs:
3839
run: cargo dev fmt --check
3940

4041
- name: Test cargo dev new lint
42+
env:
43+
RUSTFLAGS: -A unused-imports
4144
run: |
4245
cargo dev new_lint --name new_early_pass --pass early
4346
cargo dev new_lint --name new_late_pass --pass late

.github/workflows/lintcheck.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: Run lintcheck
6060
if: steps.cache-json.outputs.cache-hit != 'true'
61-
run: ./target/debug/lintcheck --format json --warn-all --crates-toml ./lintcheck/ci_crates.toml
61+
run: ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
6262

6363
- name: Upload base JSON
6464
uses: actions/upload-artifact@v4
@@ -86,7 +86,7 @@ jobs:
8686
run: cargo build --manifest-path=lintcheck/Cargo.toml
8787

8888
- name: Run lintcheck
89-
run: ./target/debug/lintcheck --format json --warn-all --crates-toml ./lintcheck/ci_crates.toml
89+
run: ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
9090

9191
- name: Upload head JSON
9292
uses: actions/upload-artifact@v4
@@ -115,4 +115,20 @@ jobs:
115115
uses: actions/download-artifact@v4
116116

117117
- name: Diff results
118-
run: ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> $GITHUB_STEP_SUMMARY
118+
# GH's summery has a maximum size of 1024k:
119+
# https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
120+
# That's why we first log to file and then to the summary and logs
121+
run: |
122+
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
123+
head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
124+
cat truncated_diff.md
125+
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
126+
127+
- name: Upload full diff
128+
uses: actions/upload-artifact@v4
129+
with:
130+
name: diff
131+
if-no-files-found: ignore
132+
path: |
133+
full_diff.md
134+
truncated_diff.md

CHANGELOG.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,53 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[ca3b3937...master](https://github.com/rust-lang/rust-clippy/compare/ca3b3937...master)
9+
[c9139bd5...master](https://github.com/rust-lang/rust-clippy/compare/c9139bd5...master)
10+
11+
## Rust 1.80
12+
13+
Current stable, released 2024-07-25
14+
15+
[View all 68 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-04-18T22%3A50%3A22Z..2024-05-30T08%3A26%3A18Z+base%3Amaster)
16+
17+
### New Lints
18+
19+
* Added [`while_float`] to `nursery`
20+
[#12765](https://github.com/rust-lang/rust-clippy/pull/12765)
21+
* Added [`macro_metavars_in_unsafe`] to `suspicious`
22+
[#12107](https://github.com/rust-lang/rust-clippy/pull/12107)
23+
* Added [`renamed_function_params`] to `restriction`
24+
[#11540](https://github.com/rust-lang/rust-clippy/pull/11540)
25+
* Added [`doc_lazy_continuation`] to `style`
26+
[#12770](https://github.com/rust-lang/rust-clippy/pull/12770)
27+
28+
### Moves and Deprecations
29+
30+
* Moved [`assigning_clones`] to `pedantic` (From `perf` now allow-by-default)
31+
[#12779](https://github.com/rust-lang/rust-clippy/pull/12779)
32+
* Moved [`single_char_pattern`] to `pedantic` (From `perf` now allow-by-default)
33+
[#11852](https://github.com/rust-lang/rust-clippy/pull/11852)
34+
35+
### Enhancements
36+
37+
* [`panic`]: Added [`allow-panic-in-tests`] configuration to allow the lint in tests
38+
[#12803](https://github.com/rust-lang/rust-clippy/pull/12803)
39+
* [`missing_const_for_fn`]: Now respects the [`msrv`] configuration
40+
[#12713](https://github.com/rust-lang/rust-clippy/pull/12713)
41+
* [`missing_panics_doc`]: No longer lints on compile-time panics
42+
[#12790](https://github.com/rust-lang/rust-clippy/pull/12790)
43+
* [`collapsible_match`]: Now considers the [`msrv`] configuration for the suggestion
44+
[#12745](https://github.com/rust-lang/rust-clippy/pull/12745)
45+
* [`useless_vec`]: Added [`allow-useless-vec-in-tests`] configuration to allow the lint in tests
46+
[#12725](https://github.com/rust-lang/rust-clippy/pull/12725)
47+
48+
### Suggestion Fixes/Improvements
49+
50+
* [`single_match`], [`single_match_else`]: Suggestions are now machine-applicable
51+
[#12726](https://github.com/rust-lang/rust-clippy/pull/12726)
1052

1153
## Rust 1.79
1254

13-
Current stable, released 2024-06-13
55+
Released 2024-06-13
1456

1557
[View all 102 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-03-08T11%3A13%3A58Z..2024-04-18T15%3A50%3A50Z+base%3Amaster)
1658

@@ -5713,6 +5755,7 @@ Released 2018-09-13
57135755
[`partialeq_to_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
57145756
[`path_buf_push_overwrite`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite
57155757
[`path_ends_with_ext`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
5758+
[`pathbuf_init_then_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#pathbuf_init_then_push
57165759
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
57175760
[`permissions_set_readonly_false`]: https://rust-lang.github.io/rust-clippy/master/index.html#permissions_set_readonly_false
57185761
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters
@@ -5788,6 +5831,7 @@ Released 2018-09-13
57885831
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
57895832
[`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used
57905833
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
5834+
[`reverse_range_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#reverse_range_loop
57915835
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
57925836
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
57935837
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
@@ -5871,6 +5915,7 @@ Released 2018-09-13
58715915
[`to_string_in_format_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
58725916
[`to_string_trait_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
58735917
[`todo`]: https://rust-lang.github.io/rust-clippy/master/index.html#todo
5918+
[`too_long_first_doc_paragraph`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
58745919
[`too_many_arguments`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
58755920
[`too_many_lines`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
58765921
[`toplevel_ref_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg
@@ -5956,6 +6001,7 @@ Released 2018-09-13
59566001
[`unused_io_amount`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
59576002
[`unused_label`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_label
59586003
[`unused_peekable`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_peekable
6004+
[`unused_result_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_result_ok
59596005
[`unused_rounding`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_rounding
59606006
[`unused_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
59616007
[`unused_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
@@ -5968,6 +6014,7 @@ Released 2018-09-13
59686014
[`use_debug`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_debug
59696015
[`use_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_self
59706016
[`used_underscore_binding`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
6017+
[`used_underscore_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
59716018
[`useless_asref`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
59726019
[`useless_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
59736020
[`useless_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
@@ -6002,6 +6049,7 @@ Released 2018-09-13
60026049
[`zero_repeat_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_repeat_side_effects
60036050
[`zero_sized_map_values`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_sized_map_values
60046051
[`zero_width_space`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_width_space
6052+
[`zombie_processes`]: https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes
60056053
[`zst_offset`]: https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset
60066054
<!-- end autogenerated links to lint list -->
60076055
<!-- begin autogenerated links to configuration documentation -->

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.81"
3+
version = "0.1.82"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"
@@ -30,8 +30,11 @@ color-print = "0.3.4"
3030
anstream = "0.6.0"
3131

3232
[dev-dependencies]
33-
ui_test = "0.24"
33+
cargo_metadata = "0.18.1"
34+
ui_test = "0.25"
3435
regex = "1.5.5"
36+
serde = { version = "1.0.145", features = ["derive"] }
37+
serde_json = "1.0.122"
3538
toml = "0.7.3"
3639
walkdir = "2.3"
3740
filetime = "0.2.9"
@@ -41,7 +44,6 @@ itertools = "0.12"
4144
clippy_utils = { path = "clippy_utils" }
4245
if_chain = "1.0"
4346
quote = "1.0.25"
44-
serde = { version = "1.0.145", features = ["derive"] }
4547
syn = { version = "2.0", features = ["full"] }
4648
futures = "0.3"
4749
parking_lot = "0.12"
@@ -51,7 +53,6 @@ tokio = { version = "1", features = ["io-util"] }
5153
rustc_tools_util = "0.3.0"
5254

5355
[features]
54-
deny-warnings = ["clippy_lints/deny-warnings"]
5556
integration = ["tempfile"]
5657
internal = ["clippy_lints/internal", "tempfile"]
5758

book/src/development/adding_lints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ for some users. Adding a configuration is done in the following steps:
739739

740740
5. Update [Lint Configuration](../lint_configuration.md)
741741

742-
Run `cargo collect-metadata` to generate documentation changes for the book.
742+
Run `cargo bless --test config-metadata` to generate documentation changes for the book.
743743

744744
[`clippy_config::conf`]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_config/src/conf.rs
745745
[`clippy_lints` lib file]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/lib.rs

0 commit comments

Comments
 (0)