-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support running the analyzer in the context of a specific configuration #49009
Comments
Do we think that teams will want to share this configuration information, or will this more likely be a per-user setting? I'd guess the latter, but am interested in other opinions. If it's a per-user setting, then we might want to put this information in a different file that isn't committed.
That's a possibility, but we'd need to
That sounds like it would work in an IDE, but I don't think they'd work well from the command-line (unless by "run configuration" you mean something different that what IDEs typically support). |
Another use case that I find lacking an intuitive solution is wanting different lints based on development phase (e.g. release branches vs feature branches). Take for example It would be much more intuitive to integrate different analysis options based on something like development branches or even based on dev machine vs CI/CD machine. That way, I could still enforce the importance of these lint rules with my entire team at the times that make the most sense. That said, workarounds do exist, they're just not elegant and sort of make certain rules feel more "forced" at certain times of the dev process more than others. |
For |
Off the top of my head, I can't think of anything else in the sdks that would be better served as an alternating configuration or alternate workflow. I'll sleep on this though. Regarding analysis_plugin, I'm working on a proof of concept that would allow specialized lints/fixes to be packaged individually and bootstrapped to the analyzer dynamically (using analyzer plugin, similar to other recent custom lint packages). My intention is to see if there's greater interest in more package- or project-specific lints/fixes, no matter how opinionated, strict, or one-off. (discussion) As food for thought, these are 2 of my proof of concept use cases I see a lot of potential for:
So +1 that having this API accessible via the analyzer_plugin would be appreciated. |
The analyzer supports config specific imports but the analysis server does not provide a way to change which config to use so IDE users always analyze with the default config which is not as useful as the config(s) from the platform(s) a user will run their app on.
Possible solutions for this could be:
It is ok that changing the config to use requires reanalysis of the entire project. Only users actively editing config specific import code should need to change the config and normally a default to one of the real platforms should be acceptable. We'll need a good blog post explaining how to use this advanced functionality. The workflow would probably be that users have a way to switch the analyzer to use the config specific import that matches the config specified by a dart or Flutter run configuration. IDEs could also show a toast offering to suggest changing the config to analyze so that the current config specific import file being edited is analyzed.
For context see: #46264 (comment)
This is currently a case where compilers show more actionable warnings and errors than the analyzer.
The text was updated successfully, but these errors were encountered: