fix(registry): add --tests to cargo-clippy, add test coverage#176
Open
zeitlinger wants to merge 6 commits intomainfrom
Open
fix(registry): add --tests to cargo-clippy, add test coverage#176zeitlinger wants to merge 6 commits intomainfrom
zeitlinger wants to merge 6 commits intomainfrom
Conversation
…errors Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
… in existing fixture Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Rust cargo-clippy registry check to lint test code as well, and adds an e2e fixture to ensure clippy failures originating from test modules are caught by CI.
Changes:
- Update the
cargo-clippyregistry entry to include test linting and adjust the fix command accordingly. - Apply clippy-driven refactors in test/helpers and internal code (
if letchains,type_complexityallow, minor collection cleanup). - Add a new
failure-in-testse2e case and update existing cargo-clippy failure snapshot output.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/registry.rs |
Adds --tests to the cargo-clippy check/fix commands; minor test helper adjustment (headers.to_vec()). |
tests/e2e.rs |
Refactors snapshot writer to use if let chains when serializing optional TOML tables. |
tests/cases/cargo-clippy/failure/test.toml |
Updates expected clippy failure output to match new target diagnostics. |
tests/cases/cargo-clippy/failure-in-tests/test.toml |
Adds new snapshot asserting clippy fails on test-only code. |
tests/cases/cargo-clippy/failure-in-tests/files/src/lib.rs |
Introduces a unit test that triggers an unused_variables failure under clippy. |
tests/cases/cargo-clippy/failure-in-tests/files/Cargo.toml |
New fixture crate manifest for the e2e case. |
tests/cases/cargo-clippy/failure-in-tests/files/mise.toml |
Uses rust = "latest" for the fixture environment. |
src/linters/renovate_deps.rs |
Adds a local #[allow(clippy::type_complexity)] in tests. |
src/init/mod.rs |
Refactors component insertion logic using an if let chain. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
--tests runs clippy in test configuration, which excludes #[cfg(not(test))] code paths. --all-targets checks lib, bins, tests, and examples, giving broader coverage without dropping any build targets. Update failure fixture: --all-targets emits two "could not compile" lines (lib then lib test) vs one with --tests. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Member
Author
|
@martincostello can you check? |
Member
|
Will look tomorrow - been busy with upstream work most of this week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--teststocargo-clippyregistry entry — test code was previously unlintedtype_complexityallow)failure-in-testse2e case to verify test code linting worksfailurefixture:(lib)→(lib test)in error message (changed by--tests)Motivated by a bug caught immediately: missing arg in test call sites went undetected until CI.
Test plan