Skip to content

Commit 67a09dc

Browse files
authored
Lead with repository failure and continue with suggestion. (#1528)
1 parent 6f64b0d commit 67a09dc

File tree

8 files changed

+37
-48
lines changed

8 files changed

+37
-48
lines changed

lib/src/report/template.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ Future<ReportSection> followsTemplate(PackageContext context) async {
200200
Issue(
201201
'Failed to verify repository URL.',
202202
suggestion:
203+
'*${repository.verificationFailure ?? 'See logs for further details.'}*\n\n'
203204
'Please provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:\n\n'
204205
' * `repository` can be cloned,\n'
205206
' * a clone of the repository contains a `pubspec.yaml`, which:,\n'
206207
' * contains `name: ${pubspec.name}`,\n'
207208
' * contains a `version` property, and,\n'
208-
' * does not contain a `publish_to` property.\n\n'
209-
'${repository.verificationFailure ?? 'status: `${repositoryStatus.name}`'}',
209+
' * does not contain a `publish_to` property.',
210210
),
211211
);
212212
}

test/end2end_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void main() {
199199
}
200200

201201
// generic, cross-platform package
202-
verifyPackage('async', '2.11.0');
202+
verifyPackage('async', '2.13.0');
203203

204204
// cross-platform package with platform-specific code
205205
verifyPackage('http', '0.13.0', skipDartdoc: true);

test/goldens/end2end/_dummy_pkg-1.0.0-null-safety.1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"grantedPoints": 15,
3232
"maxPoints": 30,
3333
"status": "failed",
34-
"summary": "### [x] 0/10 points: Provide a valid `pubspec.yaml`\n\n<details>\n<summary>\nSdk-constraint doesn't allow future stable dart 2.x releases\n</summary>\n\n`pubspec.yaml:6:8`\n\n```\n ╷\n6 │ sdk: \">=2.12.0-0 <2.12.0\"\n │ ^^^^^^^^^^^^^^^^^^^^\n ╵\n```\n\n</details>\n\n<details>\n<summary>\nFailed to verify repository URL.\n</summary>\n\nPlease provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:\n\n * `repository` can be cloned,\n * a clone of the repository contains a `pubspec.yaml`, which:,\n * contains `name: _dummy_pkg`,\n * contains a `version` property, and,\n * does not contain a `publish_to` property.\n\n`pkg/pub_integration/test_data/_dummy_pkg/pubspec.yaml` from the repository has no `version`.\n</details>\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n### [x] 0/5 points: Provide a valid `CHANGELOG.md`\n\n<details>\n<summary>\nNo `CHANGELOG.md` found.\n</summary>\n\nChangelog entries help developers follow the progress of your package. Check out the Dart conventions for [Maintaining a package changelog](https://dart.dev/tools/pub/package-layout#changelog).\n</details>\n\n### [*] 10/10 points: Use an OSI-approved license\n\nDetected license: `BSD-3-Clause`.\n"
34+
"summary": "### [x] 0/10 points: Provide a valid `pubspec.yaml`\n\n<details>\n<summary>\nSdk-constraint doesn't allow future stable dart 2.x releases\n</summary>\n\n`pubspec.yaml:6:8`\n\n```\n ╷\n6 │ sdk: \">=2.12.0-0 <2.12.0\"\n │ ^^^^^^^^^^^^^^^^^^^^\n ╵\n```\n\n</details>\n\n<details>\n<summary>\nFailed to verify repository URL.\n</summary>\n\n*`pkg/pub_integration/test_data/_dummy_pkg/pubspec.yaml` from the repository has no `version`.*\n\nPlease provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:\n\n * `repository` can be cloned,\n * a clone of the repository contains a `pubspec.yaml`, which:,\n * contains `name: _dummy_pkg`,\n * contains a `version` property, and,\n * does not contain a `publish_to` property.\n</details>\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n### [x] 0/5 points: Provide a valid `CHANGELOG.md`\n\n<details>\n<summary>\nNo `CHANGELOG.md` found.\n</summary>\n\nChangelog entries help developers follow the progress of your package. Check out the Dart conventions for [Maintaining a package changelog](https://dart.dev/tools/pub/package-layout#changelog).\n</details>\n\n### [*] 10/10 points: Use an OSI-approved license\n\nDetected license: `BSD-3-Clause`.\n"
3535
},
3636
{
3737
"id": "documentation",

test/goldens/end2end/_dummy_pkg-1.0.0-null-safety.1.json_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Sdk-constraint doesn't allow future stable dart 2.x releases
2323
Failed to verify repository URL.
2424
</summary>
2525

26+
*`pkg/pub_integration/test_data/_dummy_pkg/pubspec.yaml` from the repository has no `version`.*
27+
2628
Please provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:
2729

2830
* `repository` can be cloned,
2931
* a clone of the repository contains a `pubspec.yaml`, which:,
3032
* contains `name: _dummy_pkg`,
3133
* contains a `version` property, and,
3234
* does not contain a `publish_to` property.
33-
34-
`pkg/pub_integration/test_data/_dummy_pkg/pubspec.yaml` from the repository has no `version`.
3535
</details>
3636

3737
### [*] 5/5 points: Provide a valid `README.md`

test/goldens/end2end/async-2.11.0.json renamed to test/goldens/end2end/async-2.13.0.json

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,34 @@
66
"flutterVersions": {}
77
},
88
"packageName": "async",
9-
"packageVersion": "2.11.0",
9+
"packageVersion": "2.13.0",
1010
"pubspec": {
1111
"name": "async",
12-
"version": "2.11.0",
12+
"version": "2.13.0",
1313
"description": "Utility functions and classes related to the 'dart:async' library.",
14-
"repository": "https://github.com/dart-lang/async",
14+
"repository": "https://github.com/dart-lang/core/tree/main/pkgs/async",
15+
"issue_tracker": "https://github.com/dart-lang/core/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aasync",
16+
"topics": [
17+
"async"
18+
],
1519
"environment": {
16-
"sdk": ">=2.18.0 <3.0.0"
20+
"sdk": "^3.4.0"
1721
},
1822
"dependencies": {
1923
"collection": "^1.15.0",
20-
"meta": "^1.1.7"
24+
"meta": "^1.3.0"
2125
},
2226
"dev_dependencies": {
27+
"dart_flutter_team_lints": "^3.0.0",
2328
"fake_async": "^1.2.0",
24-
"lints": "^2.0.0",
2529
"stack_trace": "^1.10.0",
26-
"test": "^1.16.0"
30+
"test": "^1.16.6"
2731
}
2832
},
2933
"allDependencies": [
3034
"collection",
35+
"dart_flutter_team_lints",
3136
"fake_async",
32-
"lints",
3337
"meta",
3438
"stack_trace",
3539
"test"
@@ -51,7 +55,8 @@
5155
"is:dart3-compatible",
5256
"license:bsd-3-clause",
5357
"license:fsf-libre",
54-
"license:osi-approved"
58+
"license:osi-approved",
59+
"topic:async"
5560
],
5661
"report": {
5762
"sections": [
@@ -82,33 +87,34 @@
8287
{
8388
"id": "analysis",
8489
"title": "Pass static analysis",
85-
"grantedPoints": 40,
90+
"grantedPoints": 50,
8691
"maxPoints": 50,
87-
"status": "partial",
88-
"summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\n<details>\n<summary>\nINFO: 'whereNotNull' is deprecated and shouldn't be used. Use .nonNulls instead.\n</summary>\n\n`lib/src/stream_group.dart:242:10`\n\n```\n\n242 │ .whereNotNull()\n │ ^^^^^^^^^^^^\n\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/stream_group.dart`\n</details>\n"
92+
"status": "passed",
93+
"summary": "### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues\n"
8994
},
9095
{
9196
"id": "dependency",
9297
"title": "Support up-to-date dependencies",
9398
"grantedPoints": 40,
9499
"maxPoints": 40,
95100
"status": "passed",
96-
"summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`collection`]|`^1.15.0`|1.19.1|1.19.1||\n|[`meta`]|`^1.1.7`|1.17.0|1.17.0||\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`collection`]: https://pub.dev/packages/collection\n[`meta`]: https://pub.dev/packages/meta\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error.\n"
101+
"summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`collection`]|`^1.15.0`|1.19.1|1.19.1||\n|[`meta`]|`^1.3.0`|1.17.0|1.17.0||\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`collection`]: https://pub.dev/packages/collection\n[`meta`]: https://pub.dev/packages/meta\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error.\n"
97102
}
98103
]
99104
},
100105
"screenshots": [],
101106
"result": {
102-
"repositoryUrl": "https://github.com/dart-lang/async",
103-
"issueTrackerUrl": "https://github.com/dart-lang/async/issues",
107+
"repositoryUrl": "https://github.com/dart-lang/core/tree/main/pkgs/async",
108+
"issueTrackerUrl": "https://github.com/dart-lang/core/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aasync",
104109
"repositoryStatus": "verified",
105110
"repository": {
106111
"provider": "github",
107112
"host": "github.com",
108-
"repository": "dart-lang/async",
109-
"branch": "master"
113+
"repository": "dart-lang/core",
114+
"branch": "main",
115+
"path": "pkgs/async"
110116
},
111-
"contributingUrl": "https://github.com/dart-lang/async/blob/master/CONTRIBUTING.md",
117+
"contributingUrl": "https://github.com/dart-lang/core/blob/main/CONTRIBUTING.md",
112118
"licenses": [
113119
{
114120
"spdxIdentifier": "BSD-3-Clause",
@@ -133,7 +139,7 @@
133139
]
134140
}
135141
],
136-
"grantedPoints": 140,
142+
"grantedPoints": 150,
137143
"maxPoints": 160
138144
},
139145
"urlProblems": []

test/goldens/end2end/async-2.11.0.json_report.md renamed to test/goldens/end2end/async-2.13.0.json_report.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,9 @@ This package is compatible with runtime `wasm`, and will be rewarded additional
5353
See https://dart.dev/web/wasm for details.
5454

5555

56-
## 40/50 Pass static analysis
56+
## 50/50 Pass static analysis
5757

58-
### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues
59-
60-
<details>
61-
<summary>
62-
INFO: 'whereNotNull' is deprecated and shouldn't be used. Use .nonNulls instead.
63-
</summary>
64-
65-
`lib/src/stream_group.dart:242:10`
66-
67-
```
68-
69-
242 │ .whereNotNull()
70-
│ ^^^^^^^^^^^^
71-
72-
```
73-
74-
To reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/stream_group.dart`
75-
</details>
58+
### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues
7659

7760

7861
## 40/40 Support up-to-date dependencies
@@ -82,7 +65,7 @@ To reproduce make sure you are using the [lints_core](https://pub.dev/packages/l
8265
|Package|Constraint|Compatible|Latest|Notes|
8366
|:-|:-|:-|:-|:-|
8467
|[`collection`]|`^1.15.0`|1.19.1|1.19.1||
85-
|[`meta`]|`^1.1.7`|1.17.0|1.17.0||
68+
|[`meta`]|`^1.3.0`|1.17.0|1.17.0||
8669

8770
To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.
8871

test/goldens/end2end/onepub-1.1.0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"grantedPoints": 10,
121121
"maxPoints": 30,
122122
"status": "failed",
123-
"summary": "### [x] 0/10 points: Provide a valid `pubspec.yaml`\n\n<details>\n<summary>\nFailed to verify repository URL.\n</summary>\n\nPlease provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:\n\n * `repository` can be cloned,\n * a clone of the repository contains a `pubspec.yaml`, which:,\n * contains `name: onepub`,\n * contains a `version` property, and,\n * does not contain a `publish_to` property.\n\n`pubspec.yaml` from the repository URL mismatch: expected `https://github.com/noojee/onepub.dev` but got `https://github.com/onepub-dev/onepub`.\n</details>\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n### [*] 5/5 points: Provide a valid `CHANGELOG.md`\n\n### [x] 0/10 points: Use an OSI-approved license\n\n<details>\n<summary>\nNo license was recognized.\n</summary>\n\nConsider using an [OSI-approved license](https://opensource.org/licenses) in the `LICENSE` file to make it more accessible to the community.\n</details>\n"
123+
"summary": "### [x] 0/10 points: Provide a valid `pubspec.yaml`\n\n<details>\n<summary>\nFailed to verify repository URL.\n</summary>\n\n*`pubspec.yaml` from the repository URL mismatch: expected `https://github.com/noojee/onepub.dev` but got `https://github.com/onepub-dev/onepub`.*\n\nPlease provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:\n\n * `repository` can be cloned,\n * a clone of the repository contains a `pubspec.yaml`, which:,\n * contains `name: onepub`,\n * contains a `version` property, and,\n * does not contain a `publish_to` property.\n</details>\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n### [*] 5/5 points: Provide a valid `CHANGELOG.md`\n\n### [x] 0/10 points: Use an OSI-approved license\n\n<details>\n<summary>\nNo license was recognized.\n</summary>\n\nConsider using an [OSI-approved license](https://opensource.org/licenses) in the `LICENSE` file to make it more accessible to the community.\n</details>\n"
124124
},
125125
{
126126
"id": "documentation",

test/goldens/end2end/onepub-1.1.0.json_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
Failed to verify repository URL.
88
</summary>
99

10+
*`pubspec.yaml` from the repository URL mismatch: expected `https://github.com/noojee/onepub.dev` but got `https://github.com/onepub-dev/onepub`.*
11+
1012
Please provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#repository) URL in `pubspec.yaml`, such that:
1113

1214
* `repository` can be cloned,
1315
* a clone of the repository contains a `pubspec.yaml`, which:,
1416
* contains `name: onepub`,
1517
* contains a `version` property, and,
1618
* does not contain a `publish_to` property.
17-
18-
`pubspec.yaml` from the repository URL mismatch: expected `https://github.com/noojee/onepub.dev` but got `https://github.com/onepub-dev/onepub`.
1919
</details>
2020

2121
### [*] 5/5 points: Provide a valid `README.md`

0 commit comments

Comments
 (0)