From 9ec5d7131bfc91a52b42ee9a09866ddb6f1396fd Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 3 Nov 2020 08:02:19 -0800 Subject: [PATCH] Remove usage of --enable-experiment to analysis server (#69614) --- .../test_private/analysis_options.yaml | 1 + .../test_private/bin/test_private.dart | 4 +-- .../permeable/analyze_once_test.dart | 27 ------------------- 3 files changed, 3 insertions(+), 29 deletions(-) create mode 100644 packages/flutter/test_private/analysis_options.yaml diff --git a/packages/flutter/test_private/analysis_options.yaml b/packages/flutter/test_private/analysis_options.yaml new file mode 100644 index 0000000000..5e2133eb69 --- /dev/null +++ b/packages/flutter/test_private/analysis_options.yaml @@ -0,0 +1 @@ +include: ../analysis_options.yaml diff --git a/packages/flutter/test_private/bin/test_private.dart b/packages/flutter/test_private/bin/test_private.dart index 3224eba5d7..096906ecb9 100644 --- a/packages/flutter/test_private/bin/test_private.dart +++ b/packages/flutter/test_private/bin/test_private.dart @@ -13,7 +13,7 @@ import 'package:path/path.dart' as path; // See README.md for more information. final Directory flutterRoot = - Directory(path.fromUri(Platform.script)).absolute.parent.parent.parent.parent.parent; + Directory(path.fromUri(Platform.script)).absolute.parent.parent.parent.parent.parent; final Directory flutterPackageDir = Directory(path.join(flutterRoot.path, 'packages', 'flutter')); final Directory testPrivateDir = Directory(path.join(flutterPackageDir.path, 'test_private')); final Directory privateTestsDir = Directory(path.join(testPrivateDir.path, 'test')); @@ -207,7 +207,7 @@ class TestCase { printOutputDefault: true, ); final ProcessRunnerResult result = await runner.runProcess( - [flutter, 'analyze', '--current-package', '--enable-experiment=non-nullable', '--pub', '--congratulate', '.'], + [flutter, 'analyze', '--current-package', '--pub', '--congratulate', '.'], failOk: true, ); if (result.exitCode != 0) { diff --git a/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart b/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart index 09555e08c9..5526ad7b20 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart @@ -349,33 +349,6 @@ StringBuffer bar = StringBuffer('baz'); } }); - testUsingContext('analyze once supports analyzing null-safe code', () async { - const String contents = ''' -int? bar; -'''; - final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_analyze_once_test_null_safety.'); - _createDotPackages(tempDir.path, true); - - tempDir.childFile('main.dart').writeAsStringSync(contents); - try { - await runCommand( - command: AnalyzeCommand( - workingDirectory: fileSystem.directory(tempDir), - platform: _kNoColorTerminalPlatform, - fileSystem: fileSystem, - logger: logger, - processManager: processManager, - terminal: terminal, - artifacts: artifacts, - ), - arguments: ['analyze', '--no-pub', '--enable-experiment=non-nullable'], - statusTextContains: ['No issues found!'], - ); - } finally { - tryToDelete(tempDir); - } - }); - testUsingContext('analyze once returns no issues for todo comments', () async { const String contents = ''' // TODO(foobar):