diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f11517330..847f23704 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,15 +5,17 @@ on: tags: - '[0-9]+.[0-9]+.[0-9]+*' +permissions: read-all + jobs: publish: permissions: - id-token: write # This is required for requesting the JWT + id-token: write # Required for authentication using OIDC runs-on: ubuntu-latest environment: pub-dev steps: - - uses: actions/checkout@v4 - - uses: isoos/setup-dart@oidc-token + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 - name: Install dependencies run: dart pub get - name: Analyze diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index cc74f53f8..ebba007f6 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -12,6 +12,8 @@ on: env: PUB_ENVIRONMENT: bot.github +permissions: read-all + jobs: # Check code formatting and static analysis on a single OS (linux). analyze: @@ -21,7 +23,7 @@ jobs: matrix: sdk: [3.2.6] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} @@ -50,7 +52,7 @@ jobs: sdk: [3.2.6] flutter: [3.16.9] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} @@ -79,11 +81,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: '3.3.0-279.3.beta' # TODO: switch back to rolling 'dev' channel after it gets updated. - - uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b + - uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 with: # flutter-version: '3.4.0-34.1.pre' channel: 'master' # TODO: switch back to rolling 'dev' channel after it gets updated. diff --git a/CHANGELOG.md b/CHANGELOG.md index ade2fc862..99c4278b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ -## 0.22.1-wip +## 0.22.2-wip -- Require Dart 3.2.0 or later to run `pana`. +- Require Dart 3.2.0 or later to use `pana`. + +## 0.22.1 + +- Fix: unspecified `--dartdoc-version` will use the latest version in an isolated + environment. To use the SDK's `dartdoc`, set the value to `sdk`. ## 0.22.0 diff --git a/README.md b/README.md index f662b728b..5b8ce13cf 100644 --- a/README.md +++ b/README.md @@ -40,5 +40,5 @@ Options: --hosted Download and analyze a hosted package (from https://pub.dev). --[no-]dartdoc Run dartdoc and score the package on documentation coverage. (defaults to on) - --dartdoc-version The dartdoc version to use (otherwise the latest stable). + --dartdoc-version The dartdoc version to use: `sdk`, `latest` (default) or ``. ``` diff --git a/analysis_options.yaml b/analysis_options.yaml index 4f96b178a..cb063fef6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,6 +2,7 @@ include: package:lints/recommended.yaml analyzer: language: strict-casts: true + strict-inference: true errors: unused_import: error unused_local_variable: error diff --git a/bin/batch.dart b/bin/batch.dart index d49b5844a..4cbf0fdc9 100755 --- a/bin/batch.dart +++ b/bin/batch.dart @@ -41,7 +41,7 @@ import 'package:pana/src/batch/batch_run_command.dart'; /// /// dart bin/batch.dart run --packages packages.txt --config config.yaml Future main(List args) async { - final runner = CommandRunner('batch', + final runner = CommandRunner('batch', 'Runs analysis on multiple packages and compares granted score impact.') ..addCommand(BatchQueryCommand()) ..addCommand(BatchCompareCommand()) diff --git a/bin/pana.dart b/bin/pana.dart index aef587af2..52ed6bc25 100755 --- a/bin/pana.dart +++ b/bin/pana.dart @@ -72,7 +72,8 @@ final _parser = ArgParser() ) ..addOption( 'dartdoc-version', - help: 'The dartdoc version to use (otherwise the latest stable).', + help: + 'The dartdoc version to use: `sdk`, `latest` (default) or ``.', ) ..addOption( 'resources-output', @@ -107,8 +108,8 @@ ${LineSplitter.split(_parser.usage).map((l) => ' $l').join('\n')}'''); exit(ExitCode.usage.code); } -Future main(List args) async { - ArgResults result; +Future main(List args) async { + final ArgResults result; try { result = _parser.parse(args); } on FormatException catch (e) { diff --git a/lib/src/analysis_options.dart b/lib/src/analysis_options.dart index cc0eba3e2..47b21829e 100644 --- a/lib/src/analysis_options.dart +++ b/lib/src/analysis_options.dart @@ -86,9 +86,10 @@ String updatePassthroughOptions({ if (origAnalyzer is Map) { final origErrors = origAnalyzer['errors']; if (origErrors is Map) { - final customAnalyzer = customMap.putIfAbsent('analyzer', () => {}) as Map; - final customErrors = - customAnalyzer.putIfAbsent('errors', () => {}) as Map; + final customAnalyzer = + customMap.putIfAbsent('analyzer', () => {}) as Map; + final customErrors = customAnalyzer.putIfAbsent( + 'errors', () => {}) as Map; for (var key in _analyzerErrorKeys) { if (origErrors.containsKey(key)) { diff --git a/lib/src/batch/batch_compare_command.dart b/lib/src/batch/batch_compare_command.dart index 6690e0c40..06b9c4069 100644 --- a/lib/src/batch/batch_compare_command.dart +++ b/lib/src/batch/batch_compare_command.dart @@ -15,7 +15,7 @@ import '../utils.dart' show withTempDir; import 'batch_model.dart'; /// Compares pana outcomes on the selected packages. -class BatchCompareCommand extends Command { +class BatchCompareCommand extends Command { @override String get name => 'compare'; diff --git a/lib/src/batch/batch_query_command.dart b/lib/src/batch/batch_query_command.dart index 1ac295ebe..1fdcc56e7 100644 --- a/lib/src/batch/batch_query_command.dart +++ b/lib/src/batch/batch_query_command.dart @@ -16,7 +16,7 @@ import 'package:http/http.dart' as http; /// /// Additional filters are applied in the order of this list, up to the /// `--limit` parameter. -class BatchQueryCommand extends Command { +class BatchQueryCommand extends Command { final _client = http.Client(); @override diff --git a/lib/src/batch/batch_run_command.dart b/lib/src/batch/batch_run_command.dart index 1b44a9e5b..a43904537 100644 --- a/lib/src/batch/batch_run_command.dart +++ b/lib/src/batch/batch_run_command.dart @@ -15,7 +15,7 @@ import '../utils.dart' show withTempDir; import 'batch_model.dart'; /// Runs pana on the selected packages. -class BatchRunCommand extends Command { +class BatchRunCommand extends Command { @override String get name => 'run'; diff --git a/lib/src/dartdoc/dartdoc_index.dart b/lib/src/dartdoc/dartdoc_index.dart index e8fdb7b3d..8346a9d83 100644 --- a/lib/src/dartdoc/dartdoc_index.dart +++ b/lib/src/dartdoc/dartdoc_index.dart @@ -18,7 +18,7 @@ class DartdocIndex { return DartdocIndex.fromJsonList(json.decode(content) as List); } - factory DartdocIndex.fromJsonList(List jsonList) { + factory DartdocIndex.fromJsonList(List jsonList) { final list = jsonList .map((item) => DartdocIndexEntry.fromJson(item as Map)) .toList(); diff --git a/lib/src/download_utils.dart b/lib/src/download_utils.dart index 5edadc012..17da5f74d 100644 --- a/lib/src/download_utils.dart +++ b/lib/src/download_utils.dart @@ -113,7 +113,8 @@ class UrlChecker { } /// Extracts a `.tar.gz` file from [tarball] to [destination]. -Future _extractTarGz(Stream> tarball, String destination) async { +Future _extractTarGz( + Stream> tarball, String destination) async { log.fine('Extracting .tar.gz stream to $destination.'); final reader = TarReader(tarball.transform(gzip.decoder)); while (await reader.moveNext()) { diff --git a/lib/src/license_detection/tokenizer.dart b/lib/src/license_detection/tokenizer.dart index 45b2cadda..8b3e88736 100644 --- a/lib/src/license_detection/tokenizer.dart +++ b/lib/src/license_detection/tokenizer.dart @@ -192,7 +192,7 @@ String _normalizeWord(String text) { return text; } -final _headers = HashSet.from( +final _headers = HashSet.of( 'q w e r t y u i o p a s d f g h j k l z x c v b n m i ii iii iv vi vii ix xi xii xiii xiv xv' .split(' ')); diff --git a/lib/src/maintenance.dart b/lib/src/maintenance.dart index 5d1aa9a9b..95b4c4c7a 100644 --- a/lib/src/maintenance.dart +++ b/lib/src/maintenance.dart @@ -21,9 +21,9 @@ List exampleFileCandidates(String package) { } /// Returns a markdown-formatted error message for pubspec.yaml parse error. -String pubspecParseError(error) { +String pubspecParseError(Object error) { // TODO: remove this after json_annotation is updated with CheckedFromJsonException.toString() - var message = error?.toString(); + var message = error.toString(); if (error is CheckedFromJsonException) { final msg = error.message ?? 'Error with `${error.key}`: ${error.innerError}'; diff --git a/lib/src/messages.dart b/lib/src/messages.dart index bd45bd678..e0f4583ae 100644 --- a/lib/src/messages.dart +++ b/lib/src/messages.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -String runningDartanalyzerFailed(bool usesFlutter, errorMsg) { +String runningDartAnalyzerFailed(bool usesFlutter, String errorMsg) { final message = usesFlutter ? 'flutter analyze' : 'dart analyze .'; return 'Running `$message` failed with the following output:\n\n' diff --git a/lib/src/package_analyzer.dart b/lib/src/package_analyzer.dart index 99bd00cb2..640e26e23 100644 --- a/lib/src/package_analyzer.dart +++ b/lib/src/package_analyzer.dart @@ -160,7 +160,7 @@ class PackageAnalyzer { analyzerItems = await context.staticAnalysis(); } on ToolException catch (e) { context.errors - .add(runningDartanalyzerFailed(context.usesFlutter, e.message)); + .add(runningDartAnalyzerFailed(context.usesFlutter, e.message)); } } else { analyzerItems = []; diff --git a/lib/src/package_context.dart b/lib/src/package_context.dart index 3246d37eb..6e4315668 100644 --- a/lib/src/package_context.dart +++ b/lib/src/package_context.dart @@ -189,7 +189,7 @@ class PackageContext { _codeProblems = await _staticAnalysis(packageDir: packageDir); return _codeProblems!; } on ToolException catch (e) { - errors.add(messages.runningDartanalyzerFailed(usesFlutter, e.message)); + errors.add(messages.runningDartAnalyzerFailed(usesFlutter, e.message)); rethrow; } } diff --git a/lib/src/report/dependencies.dart b/lib/src/report/dependencies.dart index cf95ef125..646c29cd7 100644 --- a/lib/src/report/dependencies.dart +++ b/lib/src/report/dependencies.dart @@ -263,7 +263,7 @@ class OutdatedVersionDescription { Future> computeOutdatedVersions( PackageContext context, OutdatedPackage package) async { const acceptableUpdateDelay = Duration(days: 30); - T? tryGetFromJson(Map json, String key) { + T? tryGetFromJson(Map json, String key) { final element = json[key]; return element is T ? element : null; } @@ -293,7 +293,7 @@ Future> computeOutdatedVersions( pubHostedUrl: hostedDependency.hosted?.url ?? pubHostedUriFromEnv)); try { - final versions = tryGetFromJson( + final versions = tryGetFromJson>( versionListing as Map, 'versions'); if (versions == null) { // Bad response from pub host. diff --git a/lib/src/report/template.dart b/lib/src/report/template.dart index 689fb95eb..3173a0abf 100644 --- a/lib/src/report/template.dart +++ b/lib/src/report/template.dart @@ -266,18 +266,18 @@ Future followsTemplate(PackageContext context) async { Subsection _licenseSection(LicenseTags tags) { const title = 'Use an OSI-approved license'; - late List paragraphs; final maxPoints = 10; var grantedPoints = 0; var reportStatus = ReportStatus.failed; - String licensePluralized(List value) => + String licensePluralized(List value) => value.length > 1 ? 'licenses' : 'license'; String licenseList(List values) => values.map((e) => '`${e.spdxIdentifier}`').join(', '); final detected = RawParagraph( 'Detected ${licensePluralized(tags.licenses)}: ${licenseList(tags.licenses)}.'); + final List paragraphs; if (tags.isOnlyOsiApproved) { paragraphs = [detected]; grantedPoints = maxPoints; diff --git a/lib/src/repository/check_repository.dart b/lib/src/repository/check_repository.dart index 9ef99bbab..e8b4dd470 100644 --- a/lib/src/repository/check_repository.dart +++ b/lib/src/repository/check_repository.dart @@ -62,7 +62,7 @@ Future checkRepository({ } } - void failVerification(String message, [error, StackTrace? st]) { + void failVerification(String message, [Object? error, StackTrace? st]) { verificationFailure = message; log.info(message, error, st); } @@ -109,7 +109,7 @@ Future checkRepository({ // TODO: consider to allow the exceptions to pass here, to allow an // unrelated, but badly formatted pubspec.yaml in the repository. // ignore: prefer_typing_uninitialized_variables - var yamlDoc; + Object? yamlDoc; try { yamlDoc = yaml.loadYaml(content); } on FormatException catch (e, st) { diff --git a/lib/src/sdk_env.dart b/lib/src/sdk_env.dart index aa7a6c74b..7d6187dc2 100644 --- a/lib/src/sdk_env.dart +++ b/lib/src/sdk_env.dart @@ -105,7 +105,7 @@ class ToolEnvironment { PanaRuntimeInfo get runtimeInfo => _runtimeInfo!; - Future _init() async { + Future _init() async { final dartVersionResult = await runConstrained( [..._dartSdk.dartCmd, '--version'], environment: _dartSdk.environment, @@ -453,9 +453,16 @@ class ToolEnvironment { if (sdkDir != null) ...['--sdk-dir', sdkDir], ]; - PanaProcessResult pr; - - if (_dartdocVersion != null) { + if (_dartdocVersion == 'sdk') { + final command = + usesFlutter ? _flutterSdk._dartSdk.dartCmd : _dartSdk.dartCmd; + return await runConstrained( + [...command, 'doc', ...args], + workingDirectory: packageDir, + environment: _dartSdk.environment, + timeout: timeout, + ); + } else { if (!_globalDartdocActivated) { await runConstrained( [ @@ -464,7 +471,7 @@ class ToolEnvironment { 'global', 'activate', 'dartdoc', - _dartdocVersion, + if (_dartdocVersion != null) _dartdocVersion!, ], environment: { ..._dartSdk.environment, @@ -475,24 +482,14 @@ class ToolEnvironment { _globalDartdocActivated = true; } final command = usesFlutter ? _flutterSdk.flutterCmd : _dartSdk.dartCmd; - pr = await runConstrained( + return await runConstrained( [...command, 'pub', 'global', 'run', 'dartdoc', ...args], workingDirectory: packageDir, environment: usesFlutter ? _flutterSdk.environment : _dartSdk.environment, timeout: timeout, ); - } else { - final command = - usesFlutter ? _flutterSdk._dartSdk.dartCmd : _dartSdk.dartCmd; - pr = await runConstrained( - [...command, 'doc', ...args], - workingDirectory: packageDir, - environment: _dartSdk.environment, - timeout: timeout, - ); } - return pr; } /// Removes the `dev_dependencies` from the `pubspec.yaml`, @@ -547,7 +544,8 @@ class ToolEnvironment { // and throws an exception if it is missing. While we no longer accept // new packages without such constraint, the old versions are still valid // and should be analyzed. - final environment = parsed.putIfAbsent('environment', () => {}); + final environment = + parsed.putIfAbsent('environment', () => {}); if (environment is Map) { VersionConstraint? vc; if (environment['sdk'] is String) { diff --git a/lib/src/tool/run_constrained.dart b/lib/src/tool/run_constrained.dart index 5ab12003c..2134b8705 100644 --- a/lib/src/tool/run_constrained.dart +++ b/lib/src/tool/run_constrained.dart @@ -90,7 +90,7 @@ Future _runConstrained( killProc('Exceeded timeout of $timeout'); }); - var items = await Future.wait([ + final (exitCode, _, _) = await ( process.exitCode, process.stdout.forEach((outLine) { stdoutLines.add(outLine); @@ -108,12 +108,11 @@ Future _runConstrained( killProc('Output exceeded $maxOutputBytes bytes.'); } }) - ]); + ).wait; timer.cancel(); - final exitCode = items[0] as int; - late PanaProcessResult result; + final PanaProcessResult result; if (killed) { final encoding = systemEncoding; result = PanaProcessResult( diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 08c7e40a3..504eb29cf 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -57,14 +57,14 @@ List dartFilesFromLib(String packageDir) { } @visibleForTesting -dynamic sortedJson(obj) { - var fullJson = json.decode(json.encode(obj)); +Object? sortedJson(Object? obj) { + final fullJson = json.decode(json.encode(obj)); return _toSortedMap(fullJson); } -dynamic _toSortedMap(dynamic item) { +Object? _toSortedMap(Object? item) { if (item is Map) { - return SplayTreeMap.fromIterable(item.keys, + return SplayTreeMap.fromIterable(item.keys, value: (k) => _toSortedMap(item[k])); } else if (item is List) { return item.map(_toSortedMap).toList(); @@ -73,7 +73,7 @@ dynamic _toSortedMap(dynamic item) { } } -Map? yamlToJson(String? yamlContent) { +Map? yamlToJson(String? yamlContent) { if (yamlContent == null) { return null; } @@ -84,7 +84,7 @@ Map? yamlToJson(String? yamlContent) { // A bit paranoid, but I want to make sure this is valid JSON before we got to // the encode phase. - return sortedJson(json.decode(json.encode(yamlMap))) as Map; + return sortedJson(json.decode(json.encode(yamlMap))) as Map; } /// Returns the list of directories to focus on (e.g. bin, lib) - if they exist. diff --git a/lib/src/version.dart b/lib/src/version.dart index af84c9e23..ac3c8b6c4 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '0.22.1-wip'; +const packageVersion = '0.22.2-wip'; diff --git a/pubspec.yaml b/pubspec.yaml index 192087534..bbce8fcdb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pana description: PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package. -version: 0.22.1-wip +version: 0.22.2-wip repository: https://github.com/dart-lang/pana topics: - tool diff --git a/test/end2end_test.dart b/test/end2end_test.dart index 2cb61f9d6..8fe748e53 100644 --- a/test/end2end_test.dart +++ b/test/end2end_test.dart @@ -58,7 +58,7 @@ void main() { }) { final filename = '$package-$version.json'; group('end2end: $package $version', () { - Map? actualMap; + late final Map actualMap; setUpAll(() async { final dartdocOutputDir = p.join(tempDir, 'doc', '$package-version'); @@ -102,11 +102,11 @@ void main() { 'the Dart version used by the latest stable Flutter ({{flutter-dart-version}})') .replaceAll(RegExp('that was published [0-9]+ days ago'), 'that was published N days ago'); - actualMap = json.decode(updated) as Map?; + actualMap = json.decode(updated) as Map; }); test('matches known good', () { - void removeDependencyDetails(Map map) { + void removeDependencyDetails(Map map) { if (map.containsKey('pkgResolution') && (map['pkgResolution'] as Map).containsKey('dependencies')) { final deps = (map['pkgResolution']['dependencies'] as List) @@ -120,7 +120,7 @@ void main() { // Reduce the time-invariability of the tests: resolved and available // versions may change over time or because of SDK version changes. - removeDependencyDetails(actualMap!); + removeDependencyDetails(actualMap); final json = '${const JsonEncoder.withIndent(' ').convert(actualMap)}\n'; @@ -134,7 +134,7 @@ void main() { }); test('Report matches known good', () { - final jsonReport = actualMap!['report'] as Map?; + final jsonReport = actualMap['report'] as Map?; if (jsonReport != null) { final report = Report.fromJson(jsonReport); final renderedSections = report.sections @@ -150,7 +150,7 @@ void main() { }); test('Summary can round-trip', () { - var summary = Summary.fromJson(actualMap!); + var summary = Summary.fromJson(actualMap); var roundTrip = json.decode(json.encode(summary)); expect(roundTrip, actualMap); @@ -159,7 +159,7 @@ void main() { test('Summary tags check', () { final tagsFileContent = File('lib/src/tag/pana_tags.dart').readAsStringSync(); - final summary = Summary.fromJson(actualMap!); + final summary = Summary.fromJson(actualMap); final tags = summary.tags; if (tags != null) { for (final tag in tags) { diff --git a/test/goldens/help.txt b/test/goldens/help.txt index 7e0dd1e81..f2987f71d 100644 --- a/test/goldens/help.txt +++ b/test/goldens/help.txt @@ -12,4 +12,4 @@ Options: --hosted Download and analyze a hosted package (from https://pub.dev). --[no-]dartdoc Run dartdoc and score the package on documentation coverage. (defaults to on) - --dartdoc-version The dartdoc version to use (otherwise the latest stable). \ No newline at end of file + --dartdoc-version The dartdoc version to use: `sdk`, `latest` (default) or ``. \ No newline at end of file diff --git a/test/package_descriptor.dart b/test/package_descriptor.dart index 57342b94a..31640ddcf 100644 --- a/test/package_descriptor.dart +++ b/test/package_descriptor.dart @@ -11,7 +11,7 @@ d.DirectoryDescriptor packageWithPathDeps(String name, {String? sdkConstraint, List dependencies = const [], List lib = const [], - Map pubspecExtras = const {}, + Map pubspecExtras = const {}, List extraFiles = const []}) { final pubspec = json.encode( { @@ -57,7 +57,7 @@ d.DirectoryDescriptor package(String name, {String? sdkConstraint, Map dependencies = const {}, List lib = const [], - Map pubspecExtras = const {}, + Map pubspecExtras = const {}, List extraFiles = const []}) { final pubspec = json.encode( { diff --git a/test/package_server.dart b/test/package_server.dart index 7c55daba1..746ddb273 100644 --- a/test/package_server.dart +++ b/test/package_server.dart @@ -251,7 +251,7 @@ class _ServedPackage { /// A package that's intended to be served. class _ServedPackageVersion { - final Map pubspec; + final Map pubspec; final List contents; final DateTime? published; diff --git a/test/pubspec_test.dart b/test/pubspec_test.dart index 653495802..bdf89e0ce 100644 --- a/test/pubspec_test.dart +++ b/test/pubspec_test.dart @@ -73,7 +73,7 @@ final Pubspec emptyPubspec = Pubspec({ final Pubspec flutterPluginPubspec = Pubspec({ 'name': 'sample', 'flutter': { - 'plugin': {}, + 'plugin': {}, }, }); diff --git a/test/repository/git_local_repository_test.dart b/test/repository/git_local_repository_test.dart index 887e39b53..56f138f63 100644 --- a/test/repository/git_local_repository_test.dart +++ b/test/repository/git_local_repository_test.dart @@ -47,7 +47,7 @@ void main() { await repo.delete(); }); - void setupBranchFailures(Future Function(String branch) fn) { + void setupBranchFailures(Future Function(String branch) fn) { test('no such branch', () async { await expectLater( () => fn('branchdoesnotexists'), throwsA(isA())); diff --git a/test/screenshot_test.dart b/test/screenshot_test.dart index 9e3517505..9a353f0c5 100644 --- a/test/screenshot_test.dart +++ b/test/screenshot_test.dart @@ -193,7 +193,7 @@ void main() { }, skip: hasWebpTools); test('Report shows screenshot problems', () async { - Map pubspecExtras = { + final pubspecExtras = { 'screenshots': [ {'description': '', 'path': 'doesNotExist'} ] @@ -228,7 +228,7 @@ void main() { test('Successful report', () async { if (!hasWebpTools) return; - Map pubspecExtras = { + final pubspecExtras = { 'screenshots': [ {'description': 'description', 'path': 'static.webp'} ]