Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3ce7f9e

Browse files
committedJun 27, 2024··
Merge commit '68a799aea9b65e2444fbecfe32217ce7d5a3604f' into clippy-subtree-update
2 parents 036b38c + 68a799a commit 3ce7f9e

File tree

103 files changed

+3631
-1008
lines changed

Some content is hidden

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

103 files changed

+3631
-1008
lines changed
 
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Lintcheck
2+
3+
on: pull_request
4+
5+
env:
6+
RUST_BACKTRACE: 1
7+
CARGO_INCREMENTAL: 0
8+
9+
concurrency:
10+
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
11+
group: "${{ github.workflow }}-${{ github.event.pull_request.number}}"
12+
cancel-in-progress: true
13+
14+
jobs:
15+
# Runs lintcheck on the PR's target branch and stores the results as an artifact
16+
base:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 2
24+
25+
# HEAD is the generated merge commit `refs/pull/N/merge` between the PR and `master`, `HEAD^`
26+
# being the commit from `master` that is the base of the merge
27+
- name: Checkout base
28+
run: git checkout HEAD^
29+
30+
# Use the lintcheck from the PR to generate the JSON in case the PR modifies lintcheck in some
31+
# way
32+
- name: Checkout current lintcheck
33+
run: |
34+
rm -rf lintcheck
35+
git checkout ${{ github.sha }} -- lintcheck
36+
37+
- name: Cache lintcheck bin
38+
id: cache-lintcheck-bin
39+
uses: actions/cache@v4
40+
with:
41+
path: target/debug/lintcheck
42+
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
43+
44+
- name: Build lintcheck
45+
if: steps.cache-lintcheck-bin.outputs.cache-hit != 'true'
46+
run: cargo build --manifest-path=lintcheck/Cargo.toml
47+
48+
- name: Create cache key
49+
id: key
50+
run: echo "key=lintcheck-base-${{ hashfiles('lintcheck/**') }}-$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
51+
52+
- name: Cache results JSON
53+
id: cache-json
54+
uses: actions/cache@v4
55+
with:
56+
path: lintcheck-logs/lintcheck_crates_logs.json
57+
key: ${{ steps.key.outputs.key }}
58+
59+
- name: Run lintcheck
60+
if: steps.cache-json.outputs.cache-hit != 'true'
61+
run: ./target/debug/lintcheck --format json
62+
63+
- name: Upload base JSON
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: base
67+
path: lintcheck-logs/lintcheck_crates_logs.json
68+
69+
# Runs lintcheck on the PR and stores the results as an artifact
70+
head:
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Cache lintcheck bin
78+
id: cache-lintcheck-bin
79+
uses: actions/cache@v4
80+
with:
81+
path: target/debug/lintcheck
82+
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
83+
84+
- name: Build lintcheck
85+
if: steps.cache-lintcheck-bin.outputs.cache-hit != 'true'
86+
run: cargo build --manifest-path=lintcheck/Cargo.toml
87+
88+
- name: Run lintcheck
89+
run: ./target/debug/lintcheck --format json
90+
91+
- name: Upload head JSON
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: head
95+
path: lintcheck-logs/lintcheck_crates_logs.json
96+
97+
# Retrieves the head and base JSON results and prints the diff to the GH actions step summary
98+
diff:
99+
runs-on: ubuntu-latest
100+
101+
needs: [base, head]
102+
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@v4
106+
107+
- name: Restore lintcheck bin
108+
uses: actions/cache/restore@v4
109+
with:
110+
path: target/debug/lintcheck
111+
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
112+
fail-on-cache-miss: true
113+
114+
- name: Download JSON
115+
uses: actions/download-artifact@v4
116+
117+
- name: Diff results
118+
run: ./target/debug/lintcheck diff {base,head}/lintcheck_crates_logs.json >> $GITHUB_STEP_SUMMARY

‎src/tools/clippy/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5362,6 +5362,7 @@ Released 2018-09-13
53625362
[`extra_unused_type_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
53635363
[`fallible_impl_from`]: https://rust-lang.github.io/rust-clippy/master/index.html#fallible_impl_from
53645364
[`field_reassign_with_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
5365+
[`field_scoped_visibility_modifiers`]: https://rust-lang.github.io/rust-clippy/master/index.html#field_scoped_visibility_modifiers
53655366
[`filetype_is_file`]: https://rust-lang.github.io/rust-clippy/master/index.html#filetype_is_file
53665367
[`filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#filter_map
53675368
[`filter_map_bool_then`]: https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_bool_then
@@ -5520,6 +5521,7 @@ Released 2018-09-13
55205521
[`manual_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find_map
55215522
[`manual_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
55225523
[`manual_hash_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_hash_one
5524+
[`manual_inspect`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
55235525
[`manual_instant_elapsed`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_instant_elapsed
55245526
[`manual_is_ascii_check`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check
55255527
[`manual_is_finite`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_finite
@@ -5915,6 +5917,7 @@ Released 2018-09-13
59155917
[`unnecessary_lazy_evaluations`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
59165918
[`unnecessary_literal_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap
59175919
[`unnecessary_map_on_constructor`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_on_constructor
5920+
[`unnecessary_min_or_max`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_min_or_max
59185921
[`unnecessary_mut_passed`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
59195922
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
59205923
[`unnecessary_owned_empty_strings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings

0 commit comments

Comments
 (0)
Please sign in to comment.