Skip to content

Commit

Permalink
Merge branch 'master' into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Samarth1696 committed Aug 30, 2024
2 parents 1b2733a + b86a202 commit 87f0986
Show file tree
Hide file tree
Showing 625 changed files with 14,131 additions and 9,374 deletions.
13 changes: 10 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[alias]
bless = "test --config env.RUSTC_BLESS='1'"
uitest = "test --test compile-test"
uibless = "test --test compile-test -- -- --bless"
bless = "test -- -- --bless"
uibless = "bless --test compile-test"
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
collect-metadata = "test --test dogfood --features internal -- collect_metadata"
collect-metadata = "test --test compile-test --config env.COLLECT_METADATA='1'"

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

[unstable]
binary-dep-depinfo = true
profile-rustflags = true

[profile.dev]
split-debuginfo = "unpacked"

# Add back the containing directory of the packages we have to refer to using --manifest-path
[profile.dev.package.clippy_dev]
rustflags = ["--remap-path-prefix", "=clippy_dev"]
[profile.dev.package.lintcheck]
rustflags = ["--remap-path-prefix", "=lintcheck"]
1 change: 1 addition & 0 deletions .github/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mkdir out/master/
cp util/gh-pages/index.html out/master
cp util/gh-pages/script.js out/master
cp util/gh-pages/lints.json out/master
cp util/gh-pages/style.css out/master

if [[ -n $TAG_NAME ]]; then
echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings

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

# Run
- name: Build
run: cargo build --tests --features deny-warnings,internal
run: cargo build --tests --features internal

- name: Test
run: cargo test --features deny-warnings,internal
run: cargo test --features internal

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
working-directory: clippy_lints

- name: Test clippy_utils
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_utils

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
run: cargo test
working-directory: rustc_tools_util

- name: Test clippy_dev
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_dev

- name: Test clippy-driver
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings

concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
Expand Down Expand Up @@ -85,34 +86,34 @@ jobs:
# Run
- name: Build
run: cargo build --tests --features deny-warnings,internal
run: cargo build --tests --features internal

- name: Test
if: matrix.host == 'x86_64-unknown-linux-gnu'
run: cargo test --features deny-warnings,internal
run: cargo test --features internal

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

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal
run: cargo test --features internal
working-directory: clippy_lints

- name: Test clippy_utils
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_utils

- name: Test clippy_config
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_config

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
run: cargo test
working-directory: rustc_tools_util

- name: Test clippy_dev
run: cargo test --features deny-warnings
run: cargo test
working-directory: clippy_dev

- name: Test clippy-driver
Expand All @@ -135,11 +136,6 @@ jobs:
- name: Test metadata collection
run: cargo collect-metadata

- name: Test lint_configuration.md is up-to-date
run: |
echo "run \`cargo collect-metadata\` if this fails"
git update-index --refresh
integration_build:
needs: changelog
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/clippy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings

jobs:
clippy_dev:
Expand All @@ -28,7 +29,7 @@ jobs:

# Run
- name: Build
run: cargo build --features deny-warnings
run: cargo build
working-directory: clippy_dev

- name: Test update_lints
Expand All @@ -38,6 +39,8 @@ jobs:
run: cargo dev fmt --check

- name: Test cargo dev new lint
env:
RUSTFLAGS: -A unused-imports
run: |
cargo dev new_lint --name new_early_pass --pass early
cargo dev new_lint --name new_late_pass --pass late
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/lintcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

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

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

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

- name: Upload head JSON
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -115,4 +115,20 @@ jobs:
uses: actions/download-artifact@v4

- name: Diff results
run: ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> $GITHUB_STEP_SUMMARY
# GH's summery has a maximum size of 1024k:
# https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
# That's why we first log to file and then to the summary and logs
run: |
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
cat truncated_diff.md
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
- name: Upload full diff
uses: actions/upload-artifact@v4
with:
name: diff
if-no-files-found: ignore
path: |
full_diff.md
truncated_diff.md
52 changes: 50 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,53 @@ document.

## Unreleased / Beta / In Rust Nightly

[ca3b3937...master](https://github.com/rust-lang/rust-clippy/compare/ca3b3937...master)
[c9139bd5...master](https://github.com/rust-lang/rust-clippy/compare/c9139bd5...master)

## Rust 1.80

Current stable, released 2024-07-25

[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)

### New Lints

* Added [`while_float`] to `nursery`
[#12765](https://github.com/rust-lang/rust-clippy/pull/12765)
* Added [`macro_metavars_in_unsafe`] to `suspicious`
[#12107](https://github.com/rust-lang/rust-clippy/pull/12107)
* Added [`renamed_function_params`] to `restriction`
[#11540](https://github.com/rust-lang/rust-clippy/pull/11540)
* Added [`doc_lazy_continuation`] to `style`
[#12770](https://github.com/rust-lang/rust-clippy/pull/12770)

### Moves and Deprecations

* Moved [`assigning_clones`] to `pedantic` (From `perf` now allow-by-default)
[#12779](https://github.com/rust-lang/rust-clippy/pull/12779)
* Moved [`single_char_pattern`] to `pedantic` (From `perf` now allow-by-default)
[#11852](https://github.com/rust-lang/rust-clippy/pull/11852)

### Enhancements

* [`panic`]: Added [`allow-panic-in-tests`] configuration to allow the lint in tests
[#12803](https://github.com/rust-lang/rust-clippy/pull/12803)
* [`missing_const_for_fn`]: Now respects the [`msrv`] configuration
[#12713](https://github.com/rust-lang/rust-clippy/pull/12713)
* [`missing_panics_doc`]: No longer lints on compile-time panics
[#12790](https://github.com/rust-lang/rust-clippy/pull/12790)
* [`collapsible_match`]: Now considers the [`msrv`] configuration for the suggestion
[#12745](https://github.com/rust-lang/rust-clippy/pull/12745)
* [`useless_vec`]: Added [`allow-useless-vec-in-tests`] configuration to allow the lint in tests
[#12725](https://github.com/rust-lang/rust-clippy/pull/12725)

### Suggestion Fixes/Improvements

* [`single_match`], [`single_match_else`]: Suggestions are now machine-applicable
[#12726](https://github.com/rust-lang/rust-clippy/pull/12726)

## Rust 1.79

Current stable, released 2024-06-13
Released 2024-06-13

[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)

Expand Down Expand Up @@ -5713,6 +5755,7 @@ Released 2018-09-13
[`partialeq_to_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
[`path_buf_push_overwrite`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite
[`path_ends_with_ext`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
[`pathbuf_init_then_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#pathbuf_init_then_push
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
[`permissions_set_readonly_false`]: https://rust-lang.github.io/rust-clippy/master/index.html#permissions_set_readonly_false
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters
Expand Down Expand Up @@ -5788,6 +5831,7 @@ Released 2018-09-13
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
[`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
[`reverse_range_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#reverse_range_loop
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
Expand Down Expand Up @@ -5871,6 +5915,7 @@ Released 2018-09-13
[`to_string_in_format_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
[`to_string_trait_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
[`todo`]: https://rust-lang.github.io/rust-clippy/master/index.html#todo
[`too_long_first_doc_paragraph`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
[`too_many_arguments`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
[`too_many_lines`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
[`toplevel_ref_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg
Expand Down Expand Up @@ -5956,6 +6001,7 @@ Released 2018-09-13
[`unused_io_amount`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
[`unused_label`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_label
[`unused_peekable`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_peekable
[`unused_result_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_result_ok
[`unused_rounding`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_rounding
[`unused_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
[`unused_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
Expand All @@ -5968,6 +6014,7 @@ Released 2018-09-13
[`use_debug`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_debug
[`use_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_self
[`used_underscore_binding`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
[`used_underscore_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
[`useless_asref`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
[`useless_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
[`useless_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Expand Down Expand Up @@ -6002,6 +6049,7 @@ Released 2018-09-13
[`zero_repeat_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_repeat_side_effects
[`zero_sized_map_values`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_sized_map_values
[`zero_width_space`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_width_space
[`zombie_processes`]: https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes
[`zst_offset`]: https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset
<!-- end autogenerated links to lint list -->
<!-- begin autogenerated links to configuration documentation -->
Expand Down
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.1.81"
version = "0.1.82"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down Expand Up @@ -30,8 +30,11 @@ color-print = "0.3.4"
anstream = "0.6.0"

[dev-dependencies]
ui_test = "0.24"
cargo_metadata = "0.18.1"
ui_test = "0.25"
regex = "1.5.5"
serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1.0.122"
toml = "0.7.3"
walkdir = "2.3"
filetime = "0.2.9"
Expand All @@ -41,7 +44,6 @@ itertools = "0.12"
clippy_utils = { path = "clippy_utils" }
if_chain = "1.0"
quote = "1.0.25"
serde = { version = "1.0.145", features = ["derive"] }
syn = { version = "2.0", features = ["full"] }
futures = "0.3"
parking_lot = "0.12"
Expand All @@ -51,7 +53,6 @@ tokio = { version = "1", features = ["io-util"] }
rustc_tools_util = "0.3.0"

[features]
deny-warnings = ["clippy_lints/deny-warnings"]
integration = ["tempfile"]
internal = ["clippy_lints/internal", "tempfile"]

Expand Down
2 changes: 1 addition & 1 deletion book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ for some users. Adding a configuration is done in the following steps:

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

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

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

0 comments on commit 87f0986

Please sign in to comment.