-
Notifications
You must be signed in to change notification settings - Fork 1.7k
explore ways to improve awareness around newly added rules #57885
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
Comments
Like include: package:linter/all.yaml So every SDK bump will pull the full list of lints. User will be able to disable unwanted lints with include: package:linter/all.yaml
analyzer:
errors:
implementation_imports: ignore |
I've felt that need too. I like what Alexandre is proposing! |
Also related, a tool to generate your analysis_options.yaml, #57730. I can imagine a directive in analysis_options.yaml (even a comment): # synced with linter 1.2.3 And then |
I'm sometimes involved in writing these and I don't read them. I definitely don't think most of our users read them.
This would help some people. Personally I don't use an IDE that has any knowledge of Dart or Flutter.
I don't use I like @a14n's idea, though. That would work. |
I'm not super thrilled with the prospect of having other packages depend on the linter package, primarily because the linter package depends on the analyzer package, which would pull in a lot of other unwanted dependencies. If we really want to make it possible to include But this did raise a question: Is there a way for users of a published lint set to know which version of the SDK they need in order to have all of those lints enabled? The linter, for example, regularly contains lints in it's set that have not yet been shipped as part of a stable, or even dev, release of the SDK. Enabling those rules directly (in the package's own analysis options file) will display an error indicating that the rule isn't known; but enabling those rules indirectly (via an include) doesn't currently provide any feedback. Just saying that we might need some additional tooling to make this work better. |
At the moment folks would have to look at the generated docs for each lint and keep a running tally of "bottom". Not ideal and needless to say:
👍 Ideas welcome! Question: if folks were to specify that they want "all the lints", would they mean all the lints for the current SDK, a specific explicitly listed SDK, for a constrained set of SDKs or something else? |
Exactly. The current suggestion is "all the lints that will be supported in a future release", which might include rules that are not available in the current SDK and might be missing some that currently exist but are going to be removed (such as lints that won't apply to a future version of the language but might well apply to the version the user is using). Perhaps a better solution would be to support an "all" option directly (rather that via including some hard-coded list). I don't know the best syntax, but something like
I was thinking of something like a warning of the form "The included analysis options enables the lint rule 'avoid_using_foo', which is not defined." Not great, because it isn't very actionable, but at least it makes the problem visible. |
In my mind this could have a specific handling directly in the SDK and will not require a dependency on linter. Actually linter is already special case because the SDK packages it. It would be even more awesome if the version of linter in the SDK could be overriden by the version in And the day linter becomes a plugin (unashamed plug 😄 ) no change should be required to
Thinking about it shouldn't analyzer plugins dependencies be declared in a new special section of |
There isn't any need. The plugin architecture was carefully designed so that the dependencies of the plugin don't effect the dependencies of the package associated with the plugin. But the resolution of the |
|
In #57873, @Hixie writes:
Since this indicates I think a more general problem, I'm breaking it out for a separate discussion.
A few quick thoughts.
flutter upgrade
could include a link to relevant SDK changes in its output?/cc @kwalrath @chalin @mit-mit for thoughts.
The text was updated successfully, but these errors were encountered: