Skip to content

Commit 19a2d6c

Browse files
authored
Pass-through for formatter/page_width in analysis_options.yaml (#1408)
1 parent 0b28c61 commit 19a2d6c

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.22.13
2+
3+
- Pass-through for `formatter/page_width` in `analysis_options.yaml`.
4+
- Upgraded `lints` to `^5.0.0`
5+
16
## 0.22.12
27

38
- Updated report text for `wasm` readiness.

lib/src/analysis_options.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,15 @@ String updatePassthroughOptions({
108108
}
109109
}
110110

111+
final origFormatter = origMap['formatter'];
112+
if (origFormatter is Map) {
113+
final pageWidth = origFormatter['page_width'];
114+
if (pageWidth is int) {
115+
final customFormatter =
116+
customMap.putIfAbsent('formatter', () => <String, Object?>{}) as Map;
117+
customFormatter['page_width'] = pageWidth;
118+
}
119+
}
120+
111121
return json.encode(customMap);
112122
}

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: 2 additions & 2 deletions
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
3+
version: 0.22.13
44
repository: https://github.com/dart-lang/pana
55
topics:
66
- tool
@@ -20,7 +20,7 @@ dependencies:
2020
http: ^1.0.0
2121
io: ^1.0.0
2222
json_annotation: ^4.9.0
23-
lints: ^4.0.0
23+
lints: '>=4.0.0 <6.0.0'
2424
logging: ^1.0.0
2525
markdown: ^7.0.0
2626
meta: ^1.4.0

test/analysis_options_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ analyzer:
3636
enable-experiment:
3737
- ignored
3838
- macros
39+
formatter:
40+
unknown_key: true
41+
page_width: 123
3942
''', custom: '');
4043
expect(json.decode(content), {
4144
'analyzer': {
@@ -46,6 +49,9 @@ analyzer:
4649
'macros',
4750
],
4851
},
52+
'formatter': {
53+
'page_width': 123,
54+
},
4955
});
5056
});
5157
}

test/goldens/end2end/async-2.11.0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
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>\n"
82+
"summary": "### [*] 10/10 points: 20% or more of the public API has dartdoc comments\n\n246 out of 246 API elements (100.0 %) have documentation comments.\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",

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ Detected license: `BSD-3-Clause`.
1515

1616
### [*] 10/10 points: 20% or more of the public API has dartdoc comments
1717

18-
246 out of 263 API elements (93.5 %) have documentation comments.
19-
20-
Some symbols that are missing documentation: `async.AsyncMemoizer.AsyncMemoizer`, `async.ChunkedStreamReader.ChunkedStreamReader`, `async.DelegatingFuture.DelegatingFuture`, `async.DelegatingStream.DelegatingStream`, `async.ErrorResult.ErrorResult`.
18+
246 out of 246 API elements (100.0 %) have documentation comments.
2119

2220
### [x] 0/10 points: Package has an example
2321

0 commit comments

Comments
 (0)