fix(registry): add --tests to cargo-clippy, add test coverage#176
Merged
zeitlinger merged 6 commits intomainfrom Apr 17, 2026
Merged
fix(registry): add --tests to cargo-clippy, add test coverage#176zeitlinger merged 6 commits intomainfrom
zeitlinger merged 6 commits intomainfrom
Conversation
…errors Signed-off-by: Gregor Zeitlinger <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
… in existing fixture Signed-off-by: Gregor Zeitlinger <[email protected]>
Signed-off-by: Gregor Zeitlinger <[email protected]>
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 <[email protected]>
Member
Author
|
@martincostello can you check? |
Member
|
Will look tomorrow - been busy with upstream work most of this week. |
martincostello
approved these changes
Apr 17, 2026
3 tasks
Closed
zeitlinger
added a commit
that referenced
this pull request
Apr 20, 2026
Ports #176 (cargo-clippy --all-targets) onto the split registry module: - `src/registry/checks.rs` — add `--all-targets` to `check_cargo_clippy` - `src/registry/tests.rs` — `headers.iter().copied().collect()` → `headers.to_vec()` Also keeps the newer mise `v2026.4.16` bump already on this branch and adopts the let-chain style for `components()` in `src/init/mod.rs`. Signed-off-by: Gregor Zeitlinger <[email protected]>
zeitlinger
added a commit
that referenced
this pull request
Apr 21, 2026
## Summary Experiment: add a Win-only step before `Setup mise` that excludes `$env:LOCALAPPDATA\mise` from Defender real-time scanning. ## Why PR #176 CI timings: | OS | Setup mise | Test | Total | |---------|-----------:|------:|------:| | Linux | 10s | 39s | 1m06s | | macOS | 37s | 57s | 2m02s | | Windows | 86s | 71s | 3m22s | Win mise-action log ([job](https://github.com/grafana/flint/actions/runs/24515242200/job/71657207651)): ``` 14:15:03 Cache hit (568 MB tzst) 14:15:07 tar -xf … cache.tzst 14:16:27 Cache restored successfully ← 80s 14:16:27 mise install → "all tools are installed" (0s) ``` All 80s is tar extract of many-small-files (node_modules, pipx, dotnet SDK). Defender real-time scanning on each `CreateFile` is the usual suspect on Win hosted runners. Keeping compression (GH cache limit 10 GB) — not switching archiver. Exclusion is cheapest lever to try. ## Test plan - [ ] CI runs on this PR (Win, Mac, Linux) - [ ] Compare new Win `Setup mise` timing against 86s baseline - [ ] If impact significant (>20s savings), consider filing upstream at jdx/mise-action; otherwise revert --------- Signed-off-by: Gregor Zeitlinger <[email protected]> Co-authored-by: Copilot <[email protected]>
Merged
zeitlinger
pushed a commit
that referenced
this pull request
Apr 21, 2026
### Added - *(registry)* switch shfmt to aqua backend ([#175](#175)) ### Fixed - treat cargo-clippy as a partial fixer ([#197](#197)) - *(registry)* add --tests to cargo-clippy, add test coverage ([#176](#176)) ### Other - *(deps)* update taiki-e/install-action digest to 055f5df ([#180](#180)) - *(deps)* update dependency npm:@biomejs/biome to v2.4.12 ([#191](#191)) - *(deps)* update rust crate clap to v4.6.1 ([#196](#196)) - *(deps)* update rust crate tokio to v1.52.1 ([#192](#192)) - *(deps)* update dependency pipx:ruff to v0.15.11 ([#198](#198)) - *(deps)* update node.js to v24.15.0 ([#194](#194)) - *(deps)* update dependency npm:prettier to v3.8.3 ([#193](#193)) - exclude mise install dir from Windows Defender ([#188](#188)) - *(deps)* update dependency npm:renovate to v43.129.0 ([#200](#200)) - restructure README/docs and split registry module ([#187](#187)) - *(deps)* update dependency mise to v2026.4.15 ([#199](#199)) > [!IMPORTANT] > Close and reopen this PR to trigger CI checks. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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