-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Fix and test for 'implements' pubspec entry #4242
Fix and test for 'implements' pubspec entry #4242
Conversation
bool passing = _checkSectionOrder(pubspecLines, sectionOrder); | ||
if (!passing) { | ||
print('${indentation}Major sections should follow standard ' | ||
printError('${indentation}Major sections should follow standard ' |
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.
Minor opportunistic cleanup; I think printError
didn't exist yet when I wrote this code.
containsAllInOrder(<Matcher>[ | ||
contains( | ||
'Found a "homepage" entry; only "repository" should be used.'), | ||
]), |
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 opportunistic cleanup; I noticed when duplicating tests as a starting point that when I wrote these tests I copied from what I have since discovered is an anti-pattern: not checking the details of the output on failures, which means failure tests can pass for the wrong reasons. This commandError
+output pattern is what I've been applying throughout the codebase as I find the older style.
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
@@ -2,7 +2,7 @@ name: camera_web | |||
description: A Flutter plugin for getting information about and controlling the camera on Web. | |||
repository: https://github.com/flutter/plugins/tree/master/packages/camera/camera_web | |||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 | |||
version: 0.1.0 | |||
version: 0.1.0+1 |
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.
implements
was not added to this yaml
, but the test doesn't seem to be failing in CI? /cc @stuartmorgan
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 accidentally put the new check in the section of the command that doesn't run for publish_to: none
packages, so it didn't catch my mistake here. I'll fix that tomorrow.
The federated plugin spec calls for implementation packages to include an `implements` entry in the `plugins` section of the `pubspec.yaml` indicating what app-facing package it implements. Most of the described behaviors of the `flutter` tool aren't implemented yet, and the pub.dev features have `default_plugin` as a backstop, so we haven't noticed that they are mostly missing (or in one case, incorrect). To better future-proof the plugins, and to provide a better example to people looking at our plugins as examples of federation, this adds a CI check to make sure that we are correctly adding it, and fixes all of the missing/incorrect values it turned up. Fixes flutter/flutter#88222
The federated plugin spec calls for implementation packages to include an `implements` entry in the `plugins` section of the `pubspec.yaml` indicating what app-facing package it implements. Most of the described behaviors of the `flutter` tool aren't implemented yet, and the pub.dev features have `default_plugin` as a backstop, so we haven't noticed that they are mostly missing (or in one case, incorrect). To better future-proof the plugins, and to provide a better example to people looking at our plugins as examples of federation, this adds a CI check to make sure that we are correctly adding it, and fixes all of the missing/incorrect values it turned up. Fixes flutter/flutter#88222
The federated plugin spec calls for implementation packages to include an
implements
entry in theplugins
section of thepubspec.yaml
indicating what app-facing package it implements. Most of the described behaviors of theflutter
tool aren't implemented yet, and the pub.dev features havedefault_plugin
as a backstop, so we haven't noticed that they are mostly missing (or in one case, incorrect).To better future-proof the plugins, and to provide a better example to people looking at our plugins as examples of federation, this adds a CI check to make sure that we are correctly adding it, and fixes all of the missing/incorrect values it turned up.
Fixes flutter/flutter#88222
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).