sweeper 0.4.2
sweeper: ^0.4.2 copied to clipboard
Finds and removes unused gen-l10n translation keys from ARB files using resolved static analysis.
Changelog #
0.4.2 #
- Internal: stricter lint rules and style cleanups; no functional changes.
0.4.1 #
cleanno longer rewrites ARB files it removed nothing from: untouched files stay byte-identical instead of being reformatted by re-serialization.- Hand-written Dart files inside the gen-l10n output directory (e.g.
lib/l10n/l10n.darthelpers) are now scanned for key usage; only the generated<output-localization-file>and its_<locale>variants are excluded. Previously, keys used only in such files were wrongly deleted. tool/scripts are now scanned for key usage.- Invalid
--keepglobs report a clean error (exit 2) instead of crashing with a stack trace. --keepglobs are case-sensitive on every platform; previously they were case-insensitive on Windows only.SweepEngineaccepts a relativeprojectRootinstead of throwing a rawArgumentError.- Removing an ARB key with an explicit
nullvalue is now counted in the per-file removal totals. - Atomic writes use a pid-suffixed temp file (safe under concurrent runs) and clean up the temp file on failure.
0.4.0 #
- New
--scan/-sflag oncheckandclean: include additional package roots (monorepo siblings) when scanning for key usage. - Pub workspaces are detected automatically: all workspace members are
scanned for key usage, and the shared root
package_config.jsonis found by walking up parent directories.
0.3.0 #
- New
sortcommand: alphabetizes keys in all ARB files, keeping@@headers first and@keymetadata attached to its key.
0.2.2 #
- Widened
analyzerconstraint to>=10.0.0 <15.0.0so sweeper can coexist with packages pinned to older analyzer majors (e.g. dart_code_linter). Full test suite verified against analyzer 10.0.0 and 14.0.0.
0.2.1 #
- README: full commands & flags reference (including
--quiet).
0.2.0 #
- Hardened detection: the localizations class must be declared in the
gen-l10n output location (
output-diror the legacypackage:flutter_gensynthetic package), so identically-named classes elsewhere never count. - Colored terminal output (ANSI auto-detected, plain when piped).
- New
--quiet/-qflag oncheckandcleanto print summaries only. - Dartdoc for the full public API and a pub.dev example.
0.1.0 #
- Initial release:
checkandcleancommands with resolved-AST unused-key detection,--keepglobs,--json,--dry-run, and fail-closed behavior.