Repository navigation
Lint the test targets, which clippy currently skips - #10
Open
kridaydave wants to merge 1 commit into
Open
kridaydave wants to merge 1 commit into
kridaydave wants to merge 1 commit into
Conversation
cargo clippy -- -D warnings covers the lib and bin targets only, so the 843-line tests/cli.rs and every #[cfg(test)] block in src/ were unlinted, while cargo fmt --check at ci.yml:26 does walk them. Adding --all-targets closes that asymmetry. --locked matches the flag the test step already uses. The one warning that surfaced is fixed in the same change, since it would otherwise break the build: src/fabric.rs:234 assert_eq!(x, false) -> assert!(!x) Ran the new command on this tree. Clean, exit 0.
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.
Problem
.github/workflows/ci.yml:29rancargo clippy -- -D warnings. That is the same target selection ascargo check, which covers the lib and bin targets only. It never compiledtests/cli.rs(843 lines) or any#[cfg(test)] mod testsblock insrc/, so all of the test code was unlinted.Cargo.tomlhas no[lints]table and there is noclippy.toml, so nothing else covered it.cargo fmt --checkon the line above does walk test code, so formatting was enforced there and lints were not.Change
Two flags.
--all-targetscovers the test targets.--lockedmatches the flagcargo teston line 32 already uses, so clippy lints the graph CI actually builds rather than a re-resolved one.The single warning that
--all-targetssurfaced is fixed in the same change, because-D warningswould otherwise fail the build:Verification
I ran the new command on this tree, unmodified otherwise:
Exit 0, zero warnings. Before the
assert!fix, the same command reported exactly one warning,bool_assert_comparisonatsrc/fabric.rs:234, confirming the coverage gap was real rather than theoretical.cargo fmt --all -- --checkis clean.Not shipped
src/mount.rs:437casts a FUSEsetattrsize (u64) tousizeand resizes a buffer with it. Atruncatethrough the mount with a size nearu64::MAXreaches a multi-exabyte allocation. I did not reproduce it, so it is a write-up rather than a fix.src/registry.rs:24bounds a log walk atMAX_LOG_HOPS, and no test reaches that branch. Worth a negative test later.