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

Allow clippy::unit_arg lint in generated code #1497

Closed
wants to merge 1 commit into from

Conversation

jebrosen
Copy link
Collaborator

Fixes #1495.

This PR can be verified with cargo clippy -p request_local_state -- --no-deps, which shows two unit_arg warnings in the example before this PR and no warnings after.

This is tricky to test in CI in the current state, since we have some failing clippy lints in rocket, rocket_http, etc (some of which are "errors" in the default configuration).

@SergioBenitez
Copy link
Member

Can we simply allow all clippy lints for generated code? We could gate this in such a way that we can selectively enable clippy linting if required.

@jebrosen
Copy link
Collaborator Author

I believe we could insert #[allow(clippy::all)] in a few places - certainly for the autogenerated #[route] and #[catch] code which is the most likely to run into lints. I'm not sure if lint attributes are allowed in every single place we generate code (in particular I'm worried about uri!), but let's see how far we can get!

We could gate this in such a way that we can selectively enable clippy linting if required.

Would this part be needed right away? We could do another environment variable e.g. ROCKET_CODEGEN_UNMASK_CLIPPY=1

@SergioBenitez
Copy link
Member

Would this part be needed right away? We could do another environment variable e.g. ROCKET_CODEGEN_UNMASK_CLIPPY=1

I was intending as a cfg, to the effect of the existing rocket_unsafe_secret_key, so that we can enable it in scripts when needed, perhaps even as a alllow-fail CI task.

@SergioBenitez
Copy link
Member

This appears to no longer be required: #1495

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.

clippy: "warning: passing a unit value to a function"
2 participants