-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Linter Configurability #57153
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
Picking up on some of @alan-knight's concerns voiced around false positives for #57173: Minimally there have to be custom rule sets. Possibly we want some way to annotate source to skip specific warnings. In IDEA/IntelliJ for example, a special comment is used to suppress inspections. Something like:
We did something similar for CodePro back in the day. Thoughts, of course, are welcome! |
Annotating seems likely to be tedious and take up a lot of space in the source code. I don't know that I have any great ideas. One thought is that the rule in #57173 seems like a performance type rule. So maybe it would adequate to have a group of rules related to possible performance improvements, I don't run them all the time, but when I do I can put up with some false positives. But I think it will take some experimentation. |
When I have a configuration file at package level to opt in/out of some rules, I find annotations quite handy to define exceptions of these general rules. |
Should it be possible to disable |
I don't think there should be any hard limitations. |
If there are good reasons to violate a DO/DON'T rule, then it should instead be PREFER/AVOID. I guess it just depends on whether we can agree on what "good reasons" are... probably not in all cases, so maybe you're right, but I don't think it hurts to at least try at first. |
There might be no good reasons just before you publish but there sure are good reasons during development. |
Closing this one out in favor of more targeted follow-ups. |
Migrated from dartbug.com/22002:
Some amount of configurability would be nice eventually. Groups of rules to include/exclude, such as excluding the PREFER/AVOID rules or equivalently only including DO/DONT rules. Alternatively each rule can have an ID (same as might be used by the output or #57216), and configuration can happen at that level. The config could be specified by something like a .dartformatrc in the project root i.e. something that is shared with a team via source control. This is how jshint and jscs specify their config for example. Might be nice to integrate with .editorconfig as well (this could replace the current line length option and many others that may be requested in the future).
The text was updated successfully, but these errors were encountered: