Skip to content

Commit

Permalink
New suggestion for packages failing because of SDK _macros dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Jul 10, 2024
1 parent 84d9f7d commit 3dfa2ec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.22.9

- Updated suggestion for packages depending on SDK `_macros`.

## 0.22.8

- Updated dependency: `tar: ^2.0.0`.
Expand Down
13 changes: 10 additions & 3 deletions lib/src/report/static_analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ Future<_AnalysisResult> _analyzePackage(PackageContext context) async {
final dirs = await listFocusDirs(context.packageDir);

try {
final resolveErrorMessage = await context.resolveErrorMessage;
if (resolveErrorMessage != null) {
final errorMessage = await context.resolveErrorMessage;
if (errorMessage != null) {
String? suggestion;
if (errorMessage.contains('from sdk which doesn\'t match any versions') &&
errorMessage.contains('requires _macros ')) {
suggestion =
'The SDK package `_macros` is an experimental feature which is only available in newer SDKs. '
'Increase your minimum SDK constraint for `pub.dev` to select such SDK for analysis.';
}
return _AnalysisResult(
[Issue(resolveErrorMessage)],
[Issue(errorMessage, suggestion: suggestion)],
[],
[],
context.usesFlutter ? 'flutter pub get' : 'dart pub get',
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pana
description: PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package.
version: 0.22.8
version: 0.22.9-dev
repository: https://github.com/dart-lang/pana
topics:
- tool
Expand Down

0 comments on commit 3dfa2ec

Please sign in to comment.