A lean linter (for a sustainable future). #57427
Labels
analyzer-linter
Issues with the analyzer's support for the linter package
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
contributions-welcome
Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)
P3
A lower priority bug or feature request
type-enhancement
A request for a change that isn't a bug
type-question
A question about expected behavior or functionality
type-task
A well-defined stand-alone task
PROPOSAL: remove the linter CLI and reduce the linter package to a kernel of lint rules, tests and testing support.
Sub tasks:
bin/linter
README
docs to explain how to run lints in the new world (Label names in the same scope must be unique. #393)Background: the
linter
depends onanalyzer
package internals and so is vulnerable to prolonged build breakages between stableanalyzer
releases. At the heart of these dependencies is support for the linter command-line tool. This tool was built at the project's outset, when thedartanalyzer
did not support running lints (it does now) and has continued to evolve to support linting in particular.It duplicates a lot of logic in the
dartanalyzer
CLI. Notably it duplicates all the work done by the analyzer to setup analysis (e.g., creating resolvers, setting package roots, configuring SDK locations, etc). While effort has been made to reduce this duplication and push this functionality into the analyzer kernel, it has been the source of ongoing maintenance.The linter CLI also provides some refinements to the analyzer CLI with an eye towards supporting linting in particular. The way it displays errors, for example, is a bit more verbose, and it provides a useful
--stats
option to collect and display lint occurrence counts.PROS
By removing the CLI bits from the linter, it notably
CONS
On the downside:
Because I feel so strongly about getting the build GREEN again (sustainably) I'd like to push hard on removing the CLI. When finished, this would get us a linter that contains:
(and would IMO be a good candidate for a
1.0.0
.)In cases where CLI niceties are missed, I propose we upstream them to the
dartanalyzer
CLI proper.While I'm confident that this is the right thing to do, I realize that this change may not be popular with everyone, notably folks who have grown to depend on command-line refinements. If these folks are many (and vocal), I'd be happy to put some effort into upstreaming.
CC'ing a handful of contributors and community members but needless to say the conversation is open to all. Please chime in.
@alexeieleusis @bwilkerson @matanlurey @ochafik @dikmax @guillermooo @kevmoo @srawlins @yyoon @filiph @a14n @zoechi
Thanks in advance for any thoughts!
The text was updated successfully, but these errors were encountered: