mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Remove usage of --enable-experiment to analysis server (#69614)
This commit is contained in:
parent
c4bd14cc79
commit
9ec5d7131b
1
packages/flutter/test_private/analysis_options.yaml
Normal file
1
packages/flutter/test_private/analysis_options.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
include: ../analysis_options.yaml
|
@ -13,7 +13,7 @@ import 'package:path/path.dart' as path;
|
|||||||
// See README.md for more information.
|
// See README.md for more information.
|
||||||
|
|
||||||
final Directory flutterRoot =
|
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 flutterPackageDir = Directory(path.join(flutterRoot.path, 'packages', 'flutter'));
|
||||||
final Directory testPrivateDir = Directory(path.join(flutterPackageDir.path, 'test_private'));
|
final Directory testPrivateDir = Directory(path.join(flutterPackageDir.path, 'test_private'));
|
||||||
final Directory privateTestsDir = Directory(path.join(testPrivateDir.path, 'test'));
|
final Directory privateTestsDir = Directory(path.join(testPrivateDir.path, 'test'));
|
||||||
@ -207,7 +207,7 @@ class TestCase {
|
|||||||
printOutputDefault: true,
|
printOutputDefault: true,
|
||||||
);
|
);
|
||||||
final ProcessRunnerResult result = await runner.runProcess(
|
final ProcessRunnerResult result = await runner.runProcess(
|
||||||
<String>[flutter, 'analyze', '--current-package', '--enable-experiment=non-nullable', '--pub', '--congratulate', '.'],
|
<String>[flutter, 'analyze', '--current-package', '--pub', '--congratulate', '.'],
|
||||||
failOk: true,
|
failOk: true,
|
||||||
);
|
);
|
||||||
if (result.exitCode != 0) {
|
if (result.exitCode != 0) {
|
||||||
|
@ -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: <String>['analyze', '--no-pub', '--enable-experiment=non-nullable'],
|
|
||||||
statusTextContains: <String>['No issues found!'],
|
|
||||||
);
|
|
||||||
} finally {
|
|
||||||
tryToDelete(tempDir);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
testUsingContext('analyze once returns no issues for todo comments', () async {
|
testUsingContext('analyze once returns no issues for todo comments', () async {
|
||||||
const String contents = '''
|
const String contents = '''
|
||||||
// TODO(foobar):
|
// TODO(foobar):
|
||||||
|
Loading…
Reference in New Issue
Block a user