File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -132,3 +132,46 @@ jobs:
132
132
path : |
133
133
full_diff.md
134
134
truncated_diff.md
135
+
136
+ # Run lintcheck in fix mode to check that all suggestions are good. This only
137
+ # runs on `clippy::all` + `clippy::pedantic` as lints and suggestions from these
138
+ # categories generally not conflict and overlap.
139
+ fix :
140
+ runs-on : ubuntu-latest
141
+
142
+ steps :
143
+ - name : Checkout
144
+ uses : actions/checkout@v4
145
+ with :
146
+ fetch-depth : 2
147
+
148
+ # HEAD is the generated merge commit `refs/pull/N/merge` between the PR and `master`, `HEAD^`
149
+ # being the commit from `master` that is the base of the merge
150
+ - name : Checkout base
151
+ run : git checkout HEAD^
152
+
153
+ # Use the lintcheck from the PR to generate the JSON in case the PR modifies lintcheck in some
154
+ # way
155
+ - name : Checkout current lintcheck
156
+ run : |
157
+ rm -rf lintcheck
158
+ git checkout ${{ github.sha }} -- lintcheck
159
+
160
+ - name : Cache lintcheck bin
161
+ id : cache-lintcheck-bin
162
+ uses : actions/cache@v4
163
+ with :
164
+ path : target/debug/lintcheck
165
+ key : lintcheck-bin-${{ hashfiles('lintcheck/**') }}
166
+
167
+ - name : Build lintcheck
168
+ if : steps.cache-lintcheck-bin.outputs.cache-hit != 'true'
169
+ run : cargo build --manifest-path=lintcheck/Cargo.toml
170
+
171
+ - name : Create cache key
172
+ id : key
173
+ run : echo "key=lintcheck-base-${{ hashfiles('lintcheck/**') }}-$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
174
+
175
+ - name : Run lintcheck
176
+ if : steps.cache-json.outputs.cache-hit != 'true'
177
+ run : ./target/debug/lintcheck --crates-toml ./lintcheck/ci_crates.toml --fix
You can’t perform that action at this time.
0 commit comments