Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[flutter_lints] version 2.0 #1165

Merged
merged 5 commits into from
Mar 18, 2022
Merged

[flutter_lints] version 2.0 #1165

merged 5 commits into from
Mar 18, 2022

Conversation

goderbauer
Copy link
Member

@goderbauer goderbauer commented Mar 9, 2022

See https://github.com/dart-lang/lints/projects/1.

Fixes dart-lang/core#763
Fixes dart-lang/core#769

Depends on dart-archive/lints#72. Do not merge until that change is published. (Tests will also fail until then.)

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@goderbauer
Copy link
Member Author

/cc @mit @pq @srawlins

@goderbauer
Copy link
Member Author

@christopherfujino Can you grant a test exception for this? There isn't really any code to test...

@christopherfujino
Copy link
Contributor

test-exempt: configuration change that will effect downstream tests.

Copy link
Contributor

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mit-mit
Copy link
Member

mit-mit commented Mar 17, 2022

I tried to use the new super-dot language feature from 2.17 in a widget:

That triggers the key lint:

class OtherWidget extends StatelessWidget {
  const OtherWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      
    );
  }
}
   info • Use key in widget constructors • lib/widgets.dart:6:3 • use_key_in_widget_constructors

Can we remove that lint?

Filed flutter/flutter#100297 to track

@goderbauer
Copy link
Member Author

Can we remove that lint?

I would prefer fixing the lint since it's not a new lint added by this PR. Looks like @pq has a fix out in dart-archive/linter#3295. Will that one make the cut for 2.17?

@pq
Copy link
Contributor

pq commented Mar 17, 2022

Will that one make the cut for 2.17?

It should. As soon as I land the fix, I'll work on a new release. (That has some other super-parameter related fixes too.)

@goderbauer
Copy link
Member Author

The publishable check is failing with

Packages with an SDK constraint on a pre-release of the Dart SDK should themselves be published as a pre-release version. If this package needs Dart version 2.17.0-0, consider publishing the package as a pre-release instead.
  See https://dart.dev/tools/pub/publishing#publishing-prereleases For more information on pre-releases.

This warning is actually expected and can be ignored as described in https://dart.dev/tools/pub/publishing#publishing-previews. What's described there is exactly what we want to do here...

I don't know how to submit this, though, without turning the entire tree red because of this warning. I don't want to disable the check altogether...

@stuartmorgan Do you maybe have a suggestion?

@goderbauer
Copy link
Member Author

goderbauer commented Mar 17, 2022

Looks like flutter_plugin_tools already has a allow-pre-release flag. I don't think I want to turn that on for all packages. Maybe we should extend the flag to allow specifying package names for which pre-releases are allowed and then specify this one for it? Or would it be ok to have this on for all packages in this repository?

@stuartmorgan
Copy link
Contributor

I think it would be fine to turn it on for the whole repo. The background is that we originally added the support unconditionally for NNBD, then when we finished that transition we kept the code around in case we needed it again, but put it behind a flag since we didn't have an actual use case in mind.

I think we can start with the easiest thing, which is turning the flag on, and then revisit whether we need to add package-level targeting if we see issues in practice.

@goderbauer
Copy link
Member Author

Cool. I will make it so. Thanks!

@goderbauer goderbauer merged commit 202fb32 into flutter:main Mar 18, 2022
@goderbauer goderbauer deleted the lints2 branch March 18, 2022 18:17
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
5 participants