Unverified Commit 2cc74db6 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Migrate forbidden_from_release_tests to null safety (#81006)

parent 67384627
...@@ -2,17 +2,12 @@ ...@@ -2,17 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// @dart=2.9
// TODO(dnfield): migrate this once vm_snapshot_analysis is migrated.
// https://github.com/dart-lang/sdk/issues/45683
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:args/args.dart'; import 'package:args/args.dart';
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:file/local.dart'; import 'package:file/local.dart';
import 'package:meta/meta.dart';
import 'package:package_config/package_config.dart'; import 'package:package_config/package_config.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import 'package:process/process.dart'; import 'package:process/process.dart';
...@@ -79,7 +74,7 @@ Future<bool> validateType(String forbiddenType, File packageConfigFile) async { ...@@ -79,7 +74,7 @@ Future<bool> validateType(String forbiddenType, File packageConfigFile) async {
packageConfigFile.readAsStringSync(), packageConfigFile.readAsStringSync(),
packageConfigFile.uri, packageConfigFile.uri,
); );
final Uri packageFileUri = packageConfig.resolve(packageUri); final Uri? packageFileUri = packageConfig.resolve(packageUri);
final File packageFile = fs.file(packageFileUri); final File packageFile = fs.file(packageFileUri);
if (!packageFile.existsSync()) { if (!packageFile.existsSync()) {
print('File $packageFile does not exist - forbidden type has moved or been removed.'); print('File $packageFile does not exist - forbidden type has moved or been removed.');
...@@ -106,9 +101,9 @@ Future<bool> validateType(String forbiddenType, File packageConfigFile) async { ...@@ -106,9 +101,9 @@ Future<bool> validateType(String forbiddenType, File packageConfigFile) async {
class Options { class Options {
const Options({ const Options({
@required this.snapshot, required this.snapshot,
@required this.packageConfig, required this.packageConfig,
@required this.forbiddenTypes, required this.forbiddenTypes,
}); });
factory Options.fromArgs(List<String> args) { factory Options.fromArgs(List<String> args) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment