Skip to content

cargo-cleanme v0.2.2

Choose a tag to compare

@github-actions github-actions released this 07 Oct 02:21
· 136 commits to main since this release
Immutable release. Only release title and notes can be modified.

cargo-cleanme 0.2.2 — a matching fix.

One defect shipped in every release through 0.2.1, and this release fixes it.

The defect

A config exclude naming a directory whose canonical path contains [ or ]
— legal characters in a Windows file name — did not exclude it on Windows.
A directory named real[abc] was read as a character class, so the pattern
stopped matching the tree you named and matched neighbours you never wrote down.

Read this if you use exclude on Windows. An exclusion that silently fails
is the direction that matters: a project you excluded could still be cleaned.
Every other guard was unchanged — cleanup is opt-in, still runs through Cargo,
and still requires an ownership proof — but your stated boundary was not being
applied.

# On 0.2.1 and earlier this does not match, on Windows.
exclude = ["C:/work/real[abc]/*"]

Why it took until now

The pattern rewrite that makes a symlink-spelled pattern work was gated on an
escape it could not produce, so on Windows it never ran at all. Fixing it
exposed two more assumptions of the same kind — a Win32 \\?\ prefix whose ?
is a glob metacharacter, and a trailing \ that is a separator rather than a
dangling escape. All three are fixed.

The behaviour change is strictly protective: a written exclude now matches, so
nothing can newly become cleanable. Existing patterns are byte-identical after
the rewrite, so no configuration needs changing.

{ and } in a directory name still cannot be escaped and are left as written
— docs/USAGE.md documents the rule and this case.

Verifying a download

This release is immutable and carries a signed attestation binding it to this
repository, tag and every asset digest. See
docs/RELEASING.md.

Full details: CHANGELOG.md

Upgrading

cargo install cargo-cleanme --locked

or use the installers. A binary installed by Cargo is refused by
cargo cleanme update, by design.