-
Notifications
You must be signed in to change notification settings - Fork 6
Fix clippy issues in tests #20
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
Conversation
Should we consider adding a workflow to run |
I think that's a good idea. I'll see if I can add it to this commit. |
7669ee4 to
9169641
Compare
I've updated the workflow to have clippy check all targets (including test) and all features. I intentionally kept one of the arguments as However, for some reason it's not counting as a failed check and raising any workflow issues. The same thing is happening on other ODP repos, whereas it works as expected on my personal forks. Might have to investigate if there are some repo settings causing this. |
|
Yes I just figured it out, need to add:
|
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.
Pull Request Overview
This PR resolves Clippy warnings in test modules, streamlines data initialization, and aligns lint configurations.
- Swapped
Vecallocations for fixed-size arrays in tests to satisfy Clippy. - Renamed ambiguous
tmpvariables totmp108and made default construction explicit viaConfiguration::default(). - Updated
stylelint level todenyand enhanced the GitHub Actions Clippy workflow with--all-features,--all-targets, andfail_on_error.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/blocking.rs | Converted test Vec to array, renamed tmp to tmp108, and replaced Default::default() with Configuration::default(). |
| src/asynchronous.rs | Applied the same array and renaming changes in async tests, moved Polarity/ThermostatMode imports under cfg(feature). |
| Cargo.toml | Changed Clippy style lint from forbid to deny to avoid conflicts with future hard errors. |
| .github/workflows/check.yml | Added --all-features, --all-targets, fail_on_error, and adjusted Clippy flags. |
Comments suppressed due to low confidence (2)
.github/workflows/check.yml:75
- The workflow still forbids
clippy::stylewith-Fbut Cargo.toml now usesstyle = "deny". Change-F clippy::styleto-D clippy::styleto match the lint level.
clippy_flags: --all-features --all-targets -- -Dwarnings -F clippy::suspicious -F clippy::correctness -D clippy::perf -F clippy::style
.github/workflows/check.yml:75
- Clippy
perflints are set with-Dbut Cargo.toml usesperf = "forbid". Use-F clippy::perfto explicitly forbid performance lints rather than-D.
clippy_flags: --all-features --all-targets -- -Dwarnings -F clippy::suspicious -F clippy::correctness -D clippy::perf -F clippy::style


Running
cargo clippy --testsrevealed several issues. This PR addresses those issues.Of note is that the
stylelint was changed todeny. This is because clippy internally overrides a false positive ofneedless_returnwhich conflicts withforbid. The generated error message notes this will soon become a hard error and links to this issue recommending replacingforbidwithdeny.