ciach 0.4.3
ciach: ^0.4.3 copied to clipboard
Finds unused (never-referenced) declarations in a Dart/Flutter package by driving the Dart analysis server over LSP and querying textDocument/references.
0.4.3 #
- Add
--version, and show the version in the--helpheader. The analysis server now sees the real version instead of1.0.0.
0.4.2 #
- Support Dart 3.13 primary constructors: a dead constructor or declaring
parameter in a class header is report-only, since
--removecannot delete part of a header. - Stop reporting a primary constructor's
this : …body part as aClass.thisfinding, and a dead class's declaring parameters separately from the class. - Count only what
--removeactually deletes in its summary.
0.4.1 #
- Fix a constructor reached only through a dot shorthand (
.new(…)), from a file that never names its class, being reported as unused.
0.4.0 #
- Add config file support: any option can be set in a
ciach.yamlin the package root, and the command line overrides it.--config <path>reads one from elsewhere,--no-configignores it. - Add
-v,--verboseto narrate a run on stderr: config used, every setting and the layer it came from, scan phases, what--removetouches. Supersedes--progress. - Fix a comment mentioning
@overrideorvm:entry-pointskipping the declaration below it. (#29) - Add a secondary
textDocument/definitioncheck for zero-reference declarations, so valid uses the reference search misses no longer produce false 'unused' reports. (#26) - Add
--[no-]fail-public(default on):--no-fail-publicstill reports unused public declarations but excludes them from--set-exit-if-changed, so CI fails only on unused private ones. (#23) - Document the
--unused-union-members,--report-tojson,--generated-suffix, and--helpoptions in the README, which existed in the CLI but were missing from the options table. (#22)
0.3.0 #
- Lower the minimum Dart SDK constraint from
^3.12.2to^3.10.0. (#20) - Never report a
toJson()as unused;jsonEncode(obj)calls it by dynamic dispatch, with no source-level reference for the search to see. Opt back in with--report-tojson. (#17) - Add
--generated-suffix(repeatable) to treat extra filename suffixes as generated, on top of the built-in set (*.g.dart,*.freezed.dart, …). (#13) - Open generated files during analysis so a declaration referenced only from generated code is no longer misreported as unused. (#13)
- Fix
--removecorrupting compact single-line enums (enum E { a, b, c }) when removing one or more values. (#11) - Fix
--removedeleting the leading doc/annotation comment and header when removing a value from a compact single-line enum. (#11) - Report a whole dead class as unused, not just its constructor, so
--removedeletes the class instead of stranding it. Detection is conservative: any reference from outside the class keeps it alive. (#10) - Remove a dead
StatefulWidgettogether with its paired privateStatesubclass, soState<DeletedWidget>never dangles. (#10) - Add remove-safety guards:
--removeskips (but still reports) any removal that wouldn't compile — emptying a still-referenced enum, dropping a sole constructor withfinalfields, or dropping a super-forwarding constructor. (#10) - Add opt-in
--unused-union-membersto report sealed types that are only pattern-matched and never constructed. Report-only:--removenever deletes them. (#10) - Skip
callmethods by default; implicit-call references (obj(...)) aren't resolvable, so they were always misreported as unused. (#14) - Report an unused private constructor like any other dead declaration (and
remove it with
--remove); a sole zero-parameterClassName._()also gets a hint suggestingabstract final classto keep a static-only class non-instantiable. (#14) - Fix enum values reached only through
.valuesiteration being reported as unused. (#15) - Fix unused enum values being reported under the
enumkind instead ofenum-value. (#12) - Don't report deserialized freezed union variants as unused; the generated
fromJsonbuilds the concrete subclass directly, bypassing the redirecting factory. (#16)
0.2.0 #
- Add
--removeto delete unused declarations from source after reporting them, with a confirmation prompt;--remove --forceskips the prompt. (#4) - Skip operator overloads (
operator +,operator ==, …) by default — the analysis server can't resolve infix operator syntax back to the declaration, so a used operator was always reported as unused. Pass--operatorsto include them anyway. (#4) - Report declarations referenced only from a dartdoc
[Xxx]comment link as a separate, informational "doc-only" category (intext,json, andgithuboutput) instead of hiding them entirely. Doc-only findings are never deleted by--remove. (#4) - Clarify installation instructions: global activation vs. adding
ciachas a dev dependency. (#4)