chore(clippy): make the lint gate exit 0, decide 6.28 #24
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
linux
packaging
performance
question
tech-debt
ui
windows
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ben/openDither!24
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/clippy-green"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
cargo clippy --all-targets -- -D warningsexits 0 on this branch, in both thedebug and the release profile.
AGENTS.mdandCONTRIBUTING.mdlist it as agate next to
cargo fmt --check.6.28inengine::glitch_prewas a truncatedTAU: every other pattern in thatfunction multiplies the animation phase by
std::f32::consts::TAU, so theargument for keeping it as a named constant had nothing behind it. The other 143
warnings are cleared without touching behaviour.
Why
clippy::approx_constantis deny-by-default, so clippy stopped at that line andnobody could see the rest — a new warning could not be noticed. Fixes #4.
The
6.28decision, measuredA 96×72
sample::samplerendered withsmooth-diffuse, FNV-1a over the RGBAoutput, before → after:
775eedb743d95ae3775eedb743d95ae3c60e7a43f7c414fbc60e7a43f7c414fb28455376d7e5896628455376d7e58966a89a9984b5d87b9b7188532671eaa0d33f5c7b8d59ac181b3f5c7b8d59ac181b1903ae281e599fcb1903ae281e599fcbSo every static render (
--render,--audit,--selftest, the 1-bitfingerprints) is bit-identical: they render at phase 0. One animation frame
changes — phase 0.5, the half turn, where 0.05 % of a turn decides which way a
sub-pixel displacement rounds: 1396 of 6912 pixels differ, up to one row of
shift. That is the hair the issue predicted, and it is the half turn where the
wobble is supposed to be exactly inverted.
The 143 warnings
field_reassign_with_default(173 assignments) → the literal they werebuilding field by field; 4 comparators →
sort_by_keywithReverse;chunks_exact(n)→as_chunks::<n>(); needless borrows and casts,ifs withtwo identical arms,
.err().expect()→expect_err, aDefaultimpl that isa derive,
Tab::EffectTab→Tab::Effect.theme.rs's test module sat before other items and moved, unchanged, to theend of the file (the file's lines are otherwise identical apart from one
assert_eq!(…, true)→assert!).engine::adjust(#[allow(dead_code)], itis the single-colour path the LUT replaced) and
engine::cell_threshold(
#[allow(clippy::too_many_arguments)], eight arguments that a struct wouldturn into a per-pixel allocation).
engine::bayer16,engine::build_lut,shapes_data::find,halftone::Screen::cells_per_side, two unused testhelpers.
fx::tile_okwas a duplicate of whattile_problemchecks inline, sotile_problemnow asks it.shape::remove_bandhad two arms that removed the same stop; they are oneifwith a comment saying why the index needs no second test.Checks
Run on the branch tip
5e78b45(the three commits are below):cargo fmt --checkcargo test --release— 256 passedopendither --audit— 558 checks, 558 passed, 1 skippedopendither --controls— 62 checked, 0 failedopendither --uitest— 111 checks, 111 passedopendither --selftest— 456 renders, 0 failurescargo clippy --all-targets -- -D warnings— exit 0, debug and releaseThe lint pass alone:
cargo clippy --all-targetswent from onedeny-levelerror and 139 warnings to 0 and 0 (143 warning lines by clippy's own count, 88
of them duplicates of the same site).
Not checked
Nothing was cross-built for Windows; no
cfg(windows)code was touched, but therelease build in
README.md› Release builds was not run.Notes for the reviewer
Three commits: the
6.28decision (fix(engine)), the warning pass(
chore(clippy)) and the two documentation lines (docs) — plus the.git-blame-ignore-revsentry for the pass.The cleanup commit is in
.git-blame-ignore-revs, sogit blamelooks throughit (that file needs
git config blame.ignoreRevsFile .git-blame-ignore-revs).The suites have no row that pins clippy itself — there is no CI on this
repository, so the gate is the line in
AGENTS.mdplus the reviewer. A CI jobthat runs the six commands would close that, and is more than this issue asks
for.
`approx_constant` was deny-level, so clippy stopped there and the other 143 warnings were never looked at. What is left is cleared here, and none of it changes behaviour — the 256 tests and the five suites below say so. Mechanical, no decision in them: - 74 `field_reassign_with_default` (173 assignments) became the `T { …, ..Default::default() }` literal they were setting up field by field. - 4 comparators became `sort_by_key` with `Reverse`, which is the same order. - `chunks_exact(n)` became `as_chunks::<n>()`, which reads the same bytes and drops the same remainder. - `format!("{}", x)` on a `&str`, needless borrows and casts, `if`s with two identical arms, `.err().expect()` → `expect_err`, `or_else(|| match …)` → `or`, a `Default` impl that is a derive, `Tab::EffectTab` → `Tab::Effect` (a variant may not repeat its enum's name). - `theme.rs`'s test module sat before other items; clippy wants the tests last, so it moved, unchanged, to the end of the file. - `mod seed_tests` — see above; the file's lines are otherwise identical. With a reason next to them: - `engine::adjust` stays with `#[allow(dead_code)]`: the comment already said it is kept for a caller that wants a single colour. - `engine::cell_threshold` keeps its eight arguments, `#[allow( too_many_arguments)]`: it is called once per pixel, so a struct would be built per pixel to be read for two fields. Deleted, because nothing called them: `engine::bayer16`, `engine::build_lut`, `shapes_data::find`, `halftone::Screen::cells_per_side` and two unused test helpers. `fx::tile_ok` was the question `tile_problem` answers inline, so the two now share it instead.chore: clippy is green on main — 6.28 decided, 143 warnings clearedto chore(clippy): make the lint gate exit 0, decide 6.28View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.