Fix all clippy warnings across the workspace #246
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Running
cargo clippy --workspace --all-targets -- -D warningswas failing with 46+ clippy errors across multiple crates, preventing the use of strict clippy checking in CI/CD pipelines.Changes Made
Critical Structural Issues
impl Environment for TestEnvironmentblocks outside of functions in test modules acrosspet-conda,pet-poetry, andpet-pyenvcratesuse super::*only for Windows builds) and removed unusedPathBufimportspet-python-utilsAPI & Function Signature Improvements
&Stringto&strin function parameters (5 instances)&Vec<T>with&[T]for better performanceexpect(format!(...).as_str())withunwrap_or_else(|| panic!(...))to avoid unnecessary allocationsCode Style & Optimization
assert_eq!(value, true/false)withassert!(value)orassert!(!value)Default::default()+ field assignment.to_string()calls andPathBuf::from()conversionsTest Configuration
feature = "ci"with proper#[test]attributesCode Formatting
cargo fmt --allto ensure consistent formatting across all workspace cratesVerification
The following commands now pass without any warnings or errors:
All changes are minimal and surgical, preserving existing functionality while improving code quality, performance, and maintainability. No breaking changes were introduced.
Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.