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

Fix all actionable clippy lints and re-enable clippy in CI #96

Merged
merged 4 commits into from
Sep 18, 2024
Merged

Conversation

jfrimmel
Copy link
Owner

This PR fixes all clippy lints reported by the current stable compiler (1.81), which work on the MSRV. The non-actionable lints are suppressed by specifying the MSRV in the clippy configuration file. This way, clippy will not report lints such as the one suggesting to use the new inline formatting, which is not part of Rust 1.51). Most changes are mechanical, except for the .skip(0)-call, which is suspicious. There is a separate commit explaining this issue.

In contrast to the older approach (removed in #59), this simply fails the style CI job if there are clippy warnings or errors instead of commenting it to the pull request. This has the downside, that new lints introduced in the stable Rust compiler might break users committing new code, but at least the action is clear in such a case. The upside compared to the commenting approach is, that it is simple and will always work (even for new contributors).
Fixes #60.

This will silence many non-applicable lints (e.g. the lint suggesting to
use the new inline formatting, which is not part of Rust 1.51).
Clippy rightfully complains, that a `.skip(0)` does not make sense and
likely should have been a `.skip(1)`. This commit changes it, but it is
strange, that both versions work and pass the test suite. Therefore this
is a separate commit, so it could be reverted if necessary.
In contrast to the older approach (removed in #59), this simply fails
the `style` CI job if there are clippy warnings or errors instead of
commenting it to the pull request. This has the downside, that new lints
introduced in the stable Rust compiler might break users committing new
code, but at least the action is clear in such a case. The upside com-
pared to the commenting approach is, that it is simple and will always
work (even for new contributors).

Fixes #60.
@jfrimmel jfrimmel merged commit f9e323b into master Sep 18, 2024
10 checks passed
@jfrimmel jfrimmel deleted the clippy branch September 18, 2024 20:14
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.

Re-enable and fix clippy in CI
1 participant