-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
[v2.2.0] Stricten Lints & Fix Tests Exceptions #1319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there, and thanks for your contribution. However, there's a few things that need to be changed.
lib/src/layer/tile_layer/tile_provider/network_no_retry_image_provider.dart
Outdated
Show resolved
Hide resolved
The strict-casts mode was introduced in Dart 2.16, right now we support all the way back to Line 8 in 2d2a956
I'm okay with applying the code changes to satisfy new linter rules, but we should either drop support for earlier versions of Dart (which I think it's not worth it) or left the |
Co-authored-by: Polo <gitpjp@pm.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @pablojimpas, I think backwards-compatibility is important, and we need to support Dart 2.12 for now at least.
Also, please stop ignoring close_sinks
for the whole library, and just ignore it where I previously asked. It's a useful lint to have, and in this case, it's a false positive.
I did not add ignoring Edit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the checks are still failing, so the 'ignore' line in the tile provider needs to be added back. Let's keep the analysis_options.yaml without the ignore statement though.
Yeah - I had this same situation as well. It's because the new package score analyser workflow I added uses a different lint set, so only that one fails: https://github.com/axel-op/dart-package-analyzer. Theoretically, this means that the pub.dev score for this package, should this have been pushed without this change, would have only been 120/130. |
@pablojimpas Thanks for the heads-up, but I'm a bit confused. How should we support Dart 2.12? When you said 'leave the pubspec untouched', this PR hasn't changed it. Please can you clarify? Once Dart 2.12 is supported, this should be good to go. |
The package "dart-package-analyzer" does not use the same rules as the package "Pana" that gives the score pub.dev. I think we should at least have the same rules as the package "dart-package-analyzer". |
You might be right, in which case, we should probably just disable this check I added, because I'm not sure you can change the lint rules it uses. |
No, don't revert your PR, we can just add the rules and regulations if we have to. |
I'm not sure how to do that, so feel free to do so here :) |
Ok, I found the rules that The rules use by |
OK, that seems good to me I think. @ibrierley Any opinions? |
No opinions from me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Quite a large changeset, but I think it's all good. Many thanks for your contributions!
strong-mode
is deprecated. It should be replaced bylanguage
. Enabling stricter type checksThe exception
type 'Null' is not a subtype of type 'HttpHeaders'
does not appear in tests anymore.Add sames rules for example
Replace dynamic by the right type when possible.