-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lintcheck: clippy fixes, test on ci #6829
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
r? @camsteffen or @flip1995 |
The |
Mmh... I removed the step that replaces the I don't think I can make the toolchain action use the pinned nightly somehow for installing rustfmt...? |
70176c4
to
d2a9917
Compare
Ok, I think this works now: We first remove the |
@bors try just to be sure... |
lintcheck: clippy fixes, test on ci fixes clippy warnings in lintcheck and adds a small test (run on 3 small crates) to gha ci changelog: none
☀️ Try build successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
WDYT about making a new workflow to check lintcheck and only run it, if |
if we only check lintcheck if |
Ah right, good point. CI changes LGTM then. Changes to lintcheck also seem to resolve almost all Clippy complaints. (I think the pedantic lints would still trigger on it though) |
Didn't see any pedantic warnings with |
.github/workflows/clippy_dev.yml
Outdated
# Restore the rust-toolchain-file | ||
- name: Restore rust-toolchain-file | ||
run: git checkout rust-toolchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this right before the lintcheck
test. That way clippy_dev has to be only rebuild once.
Currently it is built three times:
- For rustfmt with +nightly
- For the other tests with +
- For lintcheck --feature lintcheck
.github/workflows/clippy_dev.yml
Outdated
- name: Test fmt | ||
run: cargo dev fmt --check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this should stay where it currently is, so it can profit from the Build
job.
I just wonder if the lintcheck test should be moved to the Clippy workflow to not have to build clippy again. |
@bors try (hijacking this PR to fix up the Clippy CI.) |
lintcheck: clippy fixes, test on ci fixes clippy warnings in lintcheck and adds a small test (run on 3 small crates) to gha ci changelog: none
Hmm.. I really don't like checking the lintcheck tool in CI. It will be compile-checked by dogfood, once this PR is done and I can continue to work on the dogfood fix. I don't think we should put 3-5min CI time on any workflow to run lintcheck tests though. Thoughts? @matthiaskrgr |
aa7f1b2
to
ac13b98
Compare
Also please review this commit: e465a8b IIUC the |
Previously, we removed the rust-toolchain file in ci and that used the toolchain action to install rustfmt and run `cargo dev fmt`. For testing lintcheck however, we need the rust-toolchain file and a pinned nightly version to build clippy. Solution: First remove the rust-toolchain file and check the formatting. Then restore the toolchain file from the git repo and run the other tests
Also -Zunstable-options isn't required anymore
It will be compile-checked by dogfood
c1b7712
to
e0dbb9f
Compare
The lintcheck job took 2m52s, which is approximately the same amount of time, that I got yesterday while testing. I'm still not convinced that that is worth it, since it is compile-checked by dogfood anyway.
The previous formatting was done according to the examples in https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions. I don't think it makes a difference, so I think reformatting to a yaml style that feels more natural (IMO) should be fine. |
I've split out the clippy lint fixes for lintcheck into #6839, I think there was something waiting on that? I guess I'll then rework this branch to not test lintcheck on ci, sigh :/ |
lintcheck: fix clippy warnings split out from #6829 changelog: none
Yes my dogfood fix, thanks for splitting it out!
Sorry. I don't think 3min CI time is worth for testing lintcheck, since it is a rarely used dev-tool, I don't expect to break often, once it gets a bit more "stable". If I'm proven wrong in this regard, I'm of course happy to include it. |
☔ The latest upstream changes (presumably #6839) made this pull request unmergeable. Please resolve the merge conflicts. |
lintcheck: add test (but don't run on ci) This is the rest of #6829 but without adding anything to ci *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: none
fixes clippy warnings in lintcheck and adds a small test (run on 3 small crates) to gha ci
changelog: none