-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Integrate package:flutter_lints into templates #81417
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
Conversation
|
/cc @mit-mit @pq @devoncarew @Hixie for discussion |
mit-mit
left a comment
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.
Just nits
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.
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.
nit: consider removing the period in the url to avoid copy/paste issues
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.
nit: "practices"
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.
if we're landing before this gets fixed, let's put the TODO (and maybe the commented-out code?) somewhere where it won't get stuck in people's analysis options for years.
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 will fix this before submitting it. The Fix has already landed in the Dart SDK and engine, just waiting for a roll into the framework.
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.
these changes are fantastic
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.
"automatically upgrade" maybe?
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.
practices
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.
isn't this redundant with the analysis options? i'm not sure i understand how they relate. if we really need both we should definitely explain the difference in these files.
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.
Reworded the paragraph above. This line just makes the set of recommended lints available. The import in the analysis_options.yaml then activates that set.
pq
left a comment
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.
🚀
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.
Does this conflict with the private return types lint? Or is that not in the recommended set
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.
That's not in the recommended set.
jonahwilliams
left a comment
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
|
Thank you! Submission is now blocked on the tree becoming green and dart-lang/sdk#58383 rolling into the framework. |
I believe the fix for this landed in dart-lang/sdk (dart-lang/sdk@f193637) ~8 days ago, so should likely already be available in flutter/flutter. |
While the fix has rolled into the engine, it's not available in flutter/flutter yet due to an unfortunate combination of engine rollbacks and tree closures. I believe the next engine roll into the framework will contain the fix, though, once the tree is open again. My newly added tests is actually currently failing because the fix is not rolled in yet: https://github.com/flutter/flutter/pull/81417/checks?check_run_id=2520340935 |
|
This broke skp_generator tests. |
Could parts of that test run presubmit (e.g. at least analyzing the code) to avoid this in the future? |
|
skp_generator should already be running presubmit |
|
I don't see it there though, weird. |
|
It was added in #81096 |
|
Fix in #82239 |
| expect(exec.exitCode, 0); | ||
| expect(exec.exitCode, isNot(0)); | ||
| String lineParser(String line) { | ||
| print('#$line#'); |
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.
was this a temporary debugging line that leaked in?
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.
Oh, yeah. Will send PR to remove.
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.
Part of #78432.
This PR enables the recommended set of lints for Flutter apps and packages from
package:flutter_lintsfor apps/packages/plugins created viaflutter create. It also adapts those templates to ensure that they are analyzer clean under the new set of lints.There's a bug in the linter wrt treatment of empty rules sections that is fixed upstream, but not rolled into the framework yet: dart-lang/sdk#58383