Skip to content

Options support to default in to all lints. #25843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pq opened this issue Feb 23, 2016 · 5 comments
Closed

Options support to default in to all lints. #25843

pq opened this issue Feb 23, 2016 · 5 comments
Assignees
Labels
customer-flutter devexp-ux legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@pq
Copy link
Member

pq commented Feb 23, 2016

Lints are currently opt-in. A rationale for this is that lints by design potentially produce false positives and, moreover, the full set of defined lints contains a number of rules that contradict each other. Confronting users with a flood of contradicting advice would, needless to say, be a bad thing. However, the downside is that when new lints are added they are not easily discovered. A possible remedy would be to add a new property to lint rule configuration in .analysis_options that enables users to enable all lints and selectively identify those they want to exclude.

Design discussion here.

@pq pq added P1 A high priority bug; for example, a single project is unusable or has many test failures legacy-area-analyzer Use area-devexp instead. devexp-ux customer-flutter labels Feb 23, 2016
@pq pq self-assigned this Feb 23, 2016
@zoechi
Copy link
Contributor

zoechi commented Feb 24, 2016

I don't have access to the doc yet (requested access).

I'd like predefined groups of lint rules like (without too much reasoning about what groups actually make sense and how they should be named), for example:

  • Dart style guide
  • Flutter style guide
  • Code health
  • Common pitfalls
  • ...

then in .analysis_options

  • enable specific groups
  • disable specific rules

New rules could get added to the group they fit in automatically (could be a breaking change though when CI builds depend on lint rules not producing warnings).

If this isn't the desired behavior

  • enable each single rule explicitly

A rule can be a member of more than one group.
A command should list all available linter rules.

@pq
Copy link
Member Author

pq commented Feb 24, 2016

Access granted!

What you describe is exactly where this could ultimately lead: targeted builtin rulesets. Ideally we should also provide a means for them to be created and hosted externally (e.g., flutter rules would be maintained by flutter, etc.)

@devoncarew devoncarew added P2 A bug or feature request we're likely to work on and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Mar 9, 2016
@bwilkerson
Copy link
Member

In general, we do not want lints to be opt-out because we want it to be possible to define contradictory lint rules and allow users to decide which rules to apply. Providing rule sets would solve most of the problems but allow lints to remain opt-in.

@DanTup
Copy link
Collaborator

DanTup commented Aug 28, 2016

we want it to be possible to define contradictory lint rules and allow users to decide which rules to apply

That sounds totally valid!

Providing rule sets would solve most of the problems but allow lints to remain opt-in.

Is there a specific case for this that we can subscribe to for updates?

Thanks!

@bwilkerson
Copy link
Member

This is probably the closest: #57364. There's been a lot of discussion, but no agreement on exactly how these groups should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter devexp-ux legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

5 participants