Skip to content

Run clippy-check action on CI #491

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

Merged
merged 5 commits into from
Jan 6, 2020
Merged

Conversation

silvanshade
Copy link
Contributor

This is a follow up draft PR for #477 that runs clippy on CI. It is not using actions-rs/clippy-check yet but I will switch over to that shortly.

I've created this as a draft because it looks like there are some additional clippy warnings that will need to be fixed first.

I've also just replaced the check step with clippy since running both would be a little redundant (cargo clippy runs cargo check already). However, I can change this if you'd like to keep them separate.

@silvanshade silvanshade force-pushed the clippy-ci branch 3 times, most recently from 425a5cc to 2183bff Compare December 21, 2019 23:58
@silvanshade
Copy link
Contributor Author

I think this is ready for review. Note that the CI will fail until the token is setup. I couldn't find which permissions are needed for the token from clippy-check README but I think it's probably just repo.

@silvanshade silvanshade marked this pull request as ready for review December 22, 2019 00:06
@silvanshade silvanshade changed the title Clippy ci Run clippy-check action on CI Dec 22, 2019
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also just replaced the check step with clippy since running both would be a little redundant (cargo clippy runs cargo check already). However, I can change this if you'd like to keep them separate.

I'd prefer to run clippy separately. The intention behind the check step was for the build to fail fast if the code doesn't compile at all, so that other steps don't need to be run. I would prefer to run clippy in the "warnings" step, instead, which I notice this branch removes.

@silvanshade
Copy link
Contributor Author

Sounds good, I'll make the suggested changes shortly.

@silvanshade silvanshade force-pushed the clippy-ci branch 2 times, most recently from 1160b84 to b6faf0f Compare December 23, 2019 22:03
@silvanshade
Copy link
Contributor Author

@hawkw Okay I've made the suggested changes!

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides fixing the build, I think this looks good to me. I'll figure out the token env var before merging & let you know if there are any other problems.

@silvanshade
Copy link
Contributor Author

@hawkw Okay, I think it's ready now. After I fixed the issue you pointed out with extern crate, several more little errors popped up 😅 But it looks like the tests are passing now 🙂

@silvanshade
Copy link
Contributor Author

silvanshade commented Dec 25, 2019

Just FYI, I asked about the token on the actions-rs gitter and this is what svartalf said:

GITHUB_TOKEN should be used preferably, but if you was to apply another token, you will need the r/w access to the Checks API

@silvanshade
Copy link
Contributor Author

Something I didn't realize about GITHUB_TOKEN is that it's auto-generated. So there's no need to actually create a separate token like I was suggesting. I've updated the PR to use that, so everything should just work without further configuration now.

@hawkw
Copy link
Member

hawkw commented Jan 2, 2020

@darinmorrison can I get you to rebase the latest master? Hopefully this will then build successfully and we can get it merged!

Sorry for keeping you waiting, I was on vacation.

@silvanshade
Copy link
Contributor Author

@hawkw no problem. Hope you had a nice vacation!

I went ahead and rebased this. It's failing on the features-nightly test though. It says #![feature] may not be used on the stable release channel which is odd because as far as I can tell, that job should be using nightly.

Maybe it's actually complaining because the #![feature(async_await)] isn't needed anymore? Should I remove that or does it not matter?

@hawkw
Copy link
Member

hawkw commented Jan 2, 2020

Yeah, the features-nightly test is supposed to run on a nightly compiler. However, all the nightly features we use are now stable, so that test needs to eventually be run as a normal test instead. For now I think it's fine to remove the #![feature(async_await)] so we can merge this PR.

@silvanshade silvanshade requested a review from hawkw January 3, 2020 03:18
@silvanshade
Copy link
Contributor Author

@hawkw I removed that #![feature(async_await)] and the test that was failing is passing now. Should be good to go now I think.

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@hawkw hawkw merged commit 986c68d into tokio-rs:master Jan 6, 2020
@silvanshade silvanshade deleted the clippy-ci branch January 12, 2020 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants