-
Notifications
You must be signed in to change notification settings - Fork 43
Use implicit-cast: false
in analysis?
#312
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
This will break many folks, I think. It can help find runtime issues, but folks need to build for it or it'll create a sea of red. I don't think it's a good idea... |
As an upside, would it warn people what they need to fix for Dart 2? |
Dart supports implicit casts in some situations. This would be a BIG change
to throw into pana.
We should chat w/ the language folks...
…On Thu, May 10, 2018 at 6:48 AM István Soós ***@***.***> wrote:
As an upside, would it warn people what they need to fix for Dart 2?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#312 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABCirkpO50o04CaSHN6fIC0WfAstvlAks5txEU-gaJpZM4T5fKQ>
.
|
@kevmoo: as we are moving closer to Dart2, would you consider the introduction of this in the analysis? The lack of it will break folks when they migrate to Dart2. |
CC @leafpetersen @vsmenon – this is a tricky one. Implicit casts don't always cause errors – but fixing all implicit casts often fixes errors... |
Not sure I understand the context - this is about turning it on for this package? Or somehow turning it on for users of the package? |
The questions is: shall we turn it on for all of the analyzed packages and make it part of the code quality score? (It is already enabled for pana) |
Would this be just a separate bit? That is, you get 1 "point" (say) if your code passes the analyzer, and another point if it passes with --no-implicit-casts? If so I think it would be fine. If not though, I think it's a big ask of folks. |
Right now there are no bonus points. You start w/ a perfect score and then you loose points if you miss things. I could imagine some "extra love" for being implicit cast clean...but that's adding a new feature |
What if we would turn them on, but classify them as hints? That way it would be visible in the list of suggestions, but the penalty would be barely noticeable. I'm not sure if it has a matching key under |
I worry about the noise here. I'll leave it to @mit-mit to handle, though. |
I'm not a big fan of having the score reflect quality for something that is opt-in. If we think this flag is high value, why is it not on by default? |
I think there is some space between "opt-in and we don't care about it" and "strong standard that is enforced". We shall consider the questions:
For example we have the following linter rules turned on for all analysis:
We have even stronger rules for Flutter packages:
These are opt-in for the average developer, but we felt that not matching these rules indicates a risk of potential error, and we should include it in the code quality score. One thing that happened really early on: developers who cared did fix the issues we have reported, although the penalty on their code quality score was minuscule. And the plus side is, there is a developer-driven override from all this: if the code has a file-level or an inline suppression of the linter rule, |
We should close this issue, me thinks... |
agreed |
Suggestion from dart-lang/pub-dev#1263 and it was also detailed in flutter/flutter#14921 (comment)
/cc @jakobr-google, @kevmoo, @mraleph
The text was updated successfully, but these errors were encountered: