diff --git a/lib/src/report/template.dart b/lib/src/report/template.dart index f7bbb6c88..689fb95eb 100644 --- a/lib/src/report/template.dart +++ b/lib/src/report/template.dart @@ -183,8 +183,20 @@ Future followsTemplate(PackageContext context) async { '${repository!.verificationFailure}')); } - final status = issues.isEmpty ? ReportStatus.passed : ReportStatus.failed; - final points = issues.isEmpty ? 10 : 0; + final unreachableFailuresIgnored = + // every issue is about an URL being unreachable + issues.isNotEmpty && + issues.every((issue) => + (issue.suggestion ?? '').contains('was unreachable')) && + // repository verification succeeded + repository?.repository != null; + + final status = issues.isEmpty + ? ReportStatus.passed + : (unreachableFailuresIgnored + ? ReportStatus.partial + : ReportStatus.failed); + final points = (issues.isEmpty || unreachableFailuresIgnored) ? 10 : 0; return Subsection( 'Provide a valid `pubspec.yaml`', issues, diff --git a/test/goldens/end2end/url_launcher-6.1.12.json b/test/goldens/end2end/url_launcher-6.1.12.json index b8ecae1ca..5a31f1fc0 100644 --- a/test/goldens/end2end/url_launcher-6.1.12.json +++ b/test/goldens/end2end/url_launcher-6.1.12.json @@ -114,10 +114,10 @@ { "id": "convention", "title": "Follow Dart file conventions", - "grantedPoints": 20, + "grantedPoints": 30, "maxPoints": 30, - "status": "failed", - "summary": "### [x] 0/10 points: Provide a valid `pubspec.yaml`\n\n
\n\nIssue tracker URL doesn't exist.\n\n\nAt the time of the analysis `https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22` was unreachable. Make sure that the website is reachable via [`HEAD`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) requests.\n
\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n\n### [*] 5/5 points: Provide a valid `CHANGELOG.md`\n\n\n### [*] 10/10 points: Use an OSI-approved license\n\nDetected license: `BSD-3-Clause`." + "status": "partial", + "summary": "### [~] 10/10 points: Provide a valid `pubspec.yaml`\n\n
\n\nIssue tracker URL doesn't exist.\n\n\nAt the time of the analysis `https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22` was unreachable. Make sure that the website is reachable via [`HEAD`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) requests.\n
\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n\n### [*] 5/5 points: Provide a valid `CHANGELOG.md`\n\n\n### [*] 10/10 points: Use an OSI-approved license\n\nDetected license: `BSD-3-Clause`." }, { "id": "documentation", @@ -164,7 +164,7 @@ "path": "packages/url_launcher/url_launcher" }, "contributingUrl": "https://github.com/flutter/packages/blob/main/CONTRIBUTING.md", - "grantedPoints": 130, + "grantedPoints": 140, "maxPoints": 140 }, "urlProblems": [] diff --git a/test/goldens/end2end/url_launcher-6.1.12.json_report.md b/test/goldens/end2end/url_launcher-6.1.12.json_report.md index c2a0cc405..567e10bfb 100644 --- a/test/goldens/end2end/url_launcher-6.1.12.json_report.md +++ b/test/goldens/end2end/url_launcher-6.1.12.json_report.md @@ -1,6 +1,6 @@ -## 20/30 Follow Dart file conventions +## 30/30 Follow Dart file conventions -### [x] 0/10 points: Provide a valid `pubspec.yaml` +### [~] 10/10 points: Provide a valid `pubspec.yaml`