Skip to content

Commit 0b28c61

Browse files
authored
Updated paragraph separation in report sections. (#1398)
1 parent 19d3b0c commit 0b28c61

36 files changed

+221
-138
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.22.12
22

33
- Updated report text for `wasm` readiness.
4+
- Updated paragraph separation in report sections.
45

56
## 0.22.11
67

lib/src/report/_common.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ String _makeSummary(List<Subsection> subsections,
130130
...subsections.map((subsection) {
131131
final paragraphsMarkdown = subsection
132132
.takeIssues(maxIssues)
133-
.map((e) => e.markdown(basePath: basePath));
133+
.map((e) => e.markdown(basePath: basePath))
134+
// ensures that paragraphs are separated but only with a single empty line
135+
.map((p) => p.endsWith('\n') ? p : '$p\n');
134136
final statusMarker = _reportStatusMarker(subsection.status);
135137
return [
136138
'### $statusMarker ${subsection.grantedPoints}/${subsection.maxPoints} points: ${subsection.description}\n',
@@ -140,7 +142,10 @@ String _makeSummary(List<Subsection> subsections,
140142
...paragraphsMarkdown,
141143
].join('\n');
142144
}),
143-
].join('\n\n');
145+
]
146+
// ensures that paragraphs are separated but only with a single empty line
147+
.map((l) => l.endsWith('\n') ? l : '$l\n')
148+
.join('\n');
144149
}
145150

146151
String? _reportStatusMarker(ReportStatus status) => const {

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pana
22
description: PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package.
3-
version: 0.22.12-dev
3+
version: 0.22.12
44
repository: https://github.com/dart-lang/pana
55
topics:
66
- tool

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"grantedPoints": 15,
4242
"maxPoints": 30,
4343
"status": "failed",
44-
"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<details>\n<summary>\nThe package description is too short.\n</summary>\n\nAdd more detail to the `description` field of `pubspec.yaml`. Use 60 to 180 characters to describe the package, what it does, and its target use case.\n</details>\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\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`."
44+
"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>\nThe package description is too short.\n</summary>\n\nAdd more detail to the `description` field of `pubspec.yaml`. Use 60 to 180 characters to describe the package, what it does, and its target use case.\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"
4545
},
4646
{
4747
"id": "documentation",
@@ -57,7 +57,7 @@
5757
"grantedPoints": 0,
5858
"maxPoints": 20,
5959
"status": "failed",
60-
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\nUnable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.\nSee https://dart.dev/web/wasm for details."
60+
"summary": "### [x] 0/20 points: Platform support detection failed\n\n<details>\n<summary>\nCould not determine supported platforms as package resolution failed.\n</summary>\n\nRun `dart pub get` for more information.\n</details>\n\n### [x] 0/0 points: WASM compatibility\n\nUnable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
6161
},
6262
{
6363
"id": "analysis",
@@ -73,7 +73,7 @@
7373
"grantedPoints": 0,
7474
"maxPoints": 40,
7575
"status": "failed",
76-
"summary": "### [x] 0/10 points: All of the package dependencies are supported in the latest version\n\n<details>\n<summary>\nSdk constraint doesn't support current Dart version {{sdk-version}}. Cannot run `dart pub outdated`.\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### [x] 0/10 points: Package supports latest stable Dart and Flutter SDKs\n\n<details>\n<summary>\nSdk constraint doesn't support current Dart version {{sdk-version}}.\n</summary>\n\n`pubspec.yaml:6:8`\n\n```\n ╷\n6 │ sdk: \">=2.12.0-0 <2.12.0\"\n │ ^^^^^^^^^^^^^^^^^^^^\n ╵\n```\n\nTry widening the upper boundary of the constraint.\n</details>\n\n### [x] 0/20 points: Compatible with dependency constraint lower bounds\n\n`dart pub downgrade` failed with:\n\n```\nOUT:\nResolving dependencies...\nERR:\nThe current Dart SDK version is {{sdk-version}}.\n\nBecause _dummy_pkg requires SDK version >=2.12.0-0 <2.12.0, version solving failed.\n```\n\nRun `dart pub downgrade` and then `dart analyze` to reproduce the above problem.\n\nYou may run `dart pub upgrade --tighten` to update your dependency constraints, see [dart.dev/go/downgrade-testing](https://dart.dev/go/downgrade-testing) for details."
76+
"summary": "### [x] 0/10 points: All of the package dependencies are supported in the latest version\n\n<details>\n<summary>\nSdk constraint doesn't support current Dart version {{sdk-version}}. Cannot run `dart pub outdated`.\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### [x] 0/10 points: Package supports latest stable Dart and Flutter SDKs\n\n<details>\n<summary>\nSdk constraint doesn't support current Dart version {{sdk-version}}.\n</summary>\n\n`pubspec.yaml:6:8`\n\n```\n ╷\n6 │ sdk: \">=2.12.0-0 <2.12.0\"\n │ ^^^^^^^^^^^^^^^^^^^^\n ╵\n```\n\nTry widening the upper boundary of the constraint.\n</details>\n\n### [x] 0/20 points: Compatible with dependency constraint lower bounds\n\n`dart pub downgrade` failed with:\n\n```\nOUT:\nResolving dependencies...\nERR:\nThe current Dart SDK version is {{sdk-version}}.\n\nBecause _dummy_pkg requires SDK version >=2.12.0-0 <2.12.0, version solving failed.\n```\n\nRun `dart pub downgrade` and then `dart analyze` to reproduce the above problem.\n\nYou may run `dart pub upgrade --tighten` to update your dependency constraints, see [dart.dev/go/downgrade-testing](https://dart.dev/go/downgrade-testing) for details.\n"
7777
}
7878
]
7979
},

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ Sdk-constraint doesn't allow future stable dart 2.x releases
1717
```
1818

1919
</details>
20+
2021
<details>
2122
<summary>
2223
The package description is too short.
2324
</summary>
2425

2526
Add more detail to the `description` field of `pubspec.yaml`. Use 60 to 180 characters to describe the package, what it does, and its target use case.
2627
</details>
28+
2729
<details>
2830
<summary>
2931
Failed to verify repository URL.
@@ -42,7 +44,6 @@ Please provide a valid [`repository`](https://dart.dev/tools/pub/pubspec#reposit
4244

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

45-
4647
### [x] 0/5 points: Provide a valid `CHANGELOG.md`
4748

4849
<details>
@@ -57,6 +58,7 @@ Changelog entries help developers follow the progress of your package. Check out
5758

5859
Detected license: `BSD-3-Clause`.
5960

61+
6062
## 10/20 Provide documentation
6163

6264
### [x] 0/10 points: 20% or more of the public API has dartdoc comments
@@ -81,8 +83,10 @@ Run `dart pub get` for more information.
8183
### [x] 0/0 points: WASM compatibility
8284

8385
Unable to detect compatibility with runtime `wasm`, and this package will not be rewarded full points in a future version of the scoring model.
86+
8487
See https://dart.dev/web/wasm for details.
8588

89+
8690
## 0/50 Pass static analysis
8791

8892
### [x] 0/50 points: code has no errors, warnings, lints, or formatting issues
@@ -149,4 +153,4 @@ Because _dummy_pkg requires SDK version >=2.12.0-0 <2.12.0, version solving fail
149153

150154
Run `dart pub downgrade` and then `dart analyze` to reproduce the above problem.
151155

152-
You may run `dart pub upgrade --tighten` to update your dependency constraints, see [dart.dev/go/downgrade-testing](https://dart.dev/go/downgrade-testing) for details.
156+
You may run `dart pub upgrade --tighten` to update your dependency constraints, see [dart.dev/go/downgrade-testing](https://dart.dev/go/downgrade-testing) for details.

test/goldens/end2end/async-2.11.0.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,23 @@
7171
"grantedPoints": 30,
7272
"maxPoints": 30,
7373
"status": "passed",
74-
"summary": "### [*] 10/10 points: Provide a valid `pubspec.yaml`\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`."
74+
"summary": "### [*] 10/10 points: Provide a valid `pubspec.yaml`\n\n### [*] 5/5 points: Provide a valid `README.md`\n\n### [*] 5/5 points: Provide a valid `CHANGELOG.md`\n\n### [*] 10/10 points: Use an OSI-approved license\n\nDetected license: `BSD-3-Clause`.\n"
7575
},
7676
{
7777
"id": "documentation",
7878
"title": "Provide documentation",
7979
"grantedPoints": 10,
8080
"maxPoints": 20,
8181
"status": "failed",
82-
"summary": "### [*] 10/10 points: 20% or more of the public API has dartdoc comments\n\n246 out of 263 API elements (93.5 %) have documentation comments.\n\nSome symbols that are missing documentation: `async.AsyncMemoizer.AsyncMemoizer`, `async.ChunkedStreamReader.ChunkedStreamReader`, `async.DelegatingFuture.DelegatingFuture`, `async.DelegatingStream.DelegatingStream`, `async.ErrorResult.ErrorResult`.\n\n### [x] 0/10 points: Package has an example\n\n<details>\n<summary>\nNo example found.\n</summary>\n\nSee [package layout](https://dart.dev/tools/pub/package-layout#examples) guidelines on how to add an example.\n</details>"
82+
"summary": "### [*] 10/10 points: 20% or more of the public API has dartdoc comments\n\n246 out of 263 API elements (93.5 %) have documentation comments.\n\nSome symbols that are missing documentation: `async.AsyncMemoizer.AsyncMemoizer`, `async.ChunkedStreamReader.ChunkedStreamReader`, `async.DelegatingFuture.DelegatingFuture`, `async.DelegatingStream.DelegatingStream`, `async.ErrorResult.ErrorResult`.\n\n### [x] 0/10 points: Package has an example\n\n<details>\n<summary>\nNo example found.\n</summary>\n\nSee [package layout](https://dart.dev/tools/pub/package-layout#examples) guidelines on how to add an example.\n</details>\n"
8383
},
8484
{
8585
"id": "platform",
8686
"title": "Platform support",
8787
"grantedPoints": 20,
8888
"maxPoints": 20,
8989
"status": "passed",
90-
"summary": "### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **macOS**, **Linux**)\n\n* ✓ Android\n* ✓ iOS\n* ✓ Windows\n* ✓ Linux\n* ✓ macOS\n* ✓ Web\n\n### [*] 0/0 points: WASM compatibility\n\nThis package is compatible with runtime `wasm`, and will be rewarded additional points in a future version of the scoring model.\nSee https://dart.dev/web/wasm for details."
90+
"summary": "### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **macOS**, **Linux**)\n\n* ✓ Android\n\n* ✓ iOS\n\n* ✓ Windows\n\n* ✓ Linux\n\n* ✓ macOS\n\n* ✓ Web\n\n### [*] 0/0 points: WASM compatibility\n\nThis package is compatible with runtime `wasm`, and will be rewarded additional points in a future version of the scoring model.\n\nSee https://dart.dev/web/wasm for details.\n"
9191
},
9292
{
9393
"id": "analysis",
@@ -103,7 +103,7 @@
103103
"grantedPoints": 40,
104104
"maxPoints": 40,
105105
"status": "passed",
106-
"summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|\n|:-|:-|:-|:-|\n|[`collection`]|`^1.15.0`|1.18.0|1.18.0|\n|[`meta`]|`^1.1.7`|1.15.0|1.15.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\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error."
106+
"summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|\n|:-|:-|:-|:-|\n|[`collection`]|`^1.15.0`|1.18.0|1.18.0|\n|[`meta`]|`^1.1.7`|1.15.0|1.15.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"
107107
}
108108
]
109109
},

test/goldens/end2end/async-2.11.0.json_report.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
### [*] 10/10 points: Provide a valid `pubspec.yaml`
44

5-
65
### [*] 5/5 points: Provide a valid `README.md`
76

8-
97
### [*] 5/5 points: Provide a valid `CHANGELOG.md`
108

11-
129
### [*] 10/10 points: Use an OSI-approved license
1310

1411
Detected license: `BSD-3-Clause`.
1512

13+
1614
## 10/20 Provide documentation
1715

1816
### [*] 10/10 points: 20% or more of the public API has dartdoc comments
@@ -31,22 +29,30 @@ No example found.
3129
See [package layout](https://dart.dev/tools/pub/package-layout#examples) guidelines on how to add an example.
3230
</details>
3331

32+
3433
## 20/20 Platform support
3534

3635
### [*] 20/20 points: Supports 6 of 6 possible platforms (**iOS**, **Android**, **Web**, **Windows**, **macOS**, **Linux**)
3736

3837
* ✓ Android
38+
3939
* ✓ iOS
40+
4041
* ✓ Windows
42+
4143
* ✓ Linux
44+
4245
* ✓ macOS
46+
4347
* ✓ Web
4448

4549
### [*] 0/0 points: WASM compatibility
4650

4751
This package is compatible with runtime `wasm`, and will be rewarded additional points in a future version of the scoring model.
52+
4853
See https://dart.dev/web/wasm for details.
4954

55+
5056
## 50/50 Pass static analysis
5157

5258
### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues
@@ -66,10 +72,8 @@ To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-depe
6672
[`collection`]: https://pub.dev/packages/collection
6773
[`meta`]: https://pub.dev/packages/meta
6874

69-
7075
### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs
7176

72-
7377
### [*] 20/20 points: Compatible with dependency constraint lower bounds
7478

75-
`pub downgrade` does not expose any static analysis error.
79+
`pub downgrade` does not expose any static analysis error.

0 commit comments

Comments
 (0)