Skip to content
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

Make rust_clippy providers match rustfmt_test #1806

Merged
merged 4 commits into from
Feb 24, 2023
Merged

Conversation

0xAda
Copy link
Contributor

@0xAda 0xAda commented Jan 29, 2023

This fixes rust_clippy failing on shared and static libraries because does not have mandatory providers: 'CrateInfo'

@google-cla
Copy link

google-cla bot commented Jan 29, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

@UebelAndre
Copy link
Collaborator

@0x4da friendly ping 😄

@0xAda
Copy link
Contributor Author

0xAda commented Feb 23, 2023

@UebelAndre I've added tests in the same style as the existing clippy tests, but I'm not sure if that is the best way of doing it.

In the example of the rustfmt tests, everything is done on the source of a binary, thats currently not the case for clippy (and cant be if we're testing proc macros), I decided against using a loop over variants like in rustfmt, as I couldn't see a nice way to deal with special casing binary, proc_macro and test.

The rustfmt example also doesn't quite map perfectly because rustfmt rules run as a test, whereas clippy rules run as a build step, I'm not sure I understand the reasoning behind this, it feels like it should be testy to me, but I'm unaware of the reasoning behind the current way of doing things. I also have the same question of the clippy test, is there a reason thats a sh_binary instead of a sh_test?

@UebelAndre
Copy link
Collaborator

I think the thing that matters most is that we have clippy running against rust_shared_library in some CI job. What you have looks good enough to me :)

@UebelAndre UebelAndre merged commit 75bba7b into bazelbuild:main Feb 24, 2023
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.

2 participants