Skip to content

Commit a664f08

Browse files
authored
In test of --(no-)fatal-infos analyzer flags, pin missing_return to info (flutter#120797)
* In test of --(no-)fatal-infos analyzer flags, pin missing_return to info * Remove trailing spaces
1 parent a513d4e commit a664f08

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

packages/flutter_tools/test/integration.shard/analyze_once_test.dart

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,13 @@ StringBuffer bar = StringBuffer('baz');
295295
int analyze() {}
296296
''';
297297

298+
final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml'));
299+
optionsFile.writeAsStringSync('''
300+
analyzer:
301+
errors:
302+
missing_return: info
303+
''');
304+
298305
fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode);
299306
await runCommand(
300307
arguments: <String>['analyze', '--no-pub'],
@@ -305,13 +312,20 @@ int analyze() {}
305312
exitMessageContains: '1 issue found.',
306313
exitCode: 1,
307314
);
308-
}, skip: true); // https://github.com/flutter/flutter/issues/120750
315+
});
309316

310317
testWithoutContext('analyze once with no-fatal-infos has info issue finally exit code 0.', () async {
311318
const String infoSourceCode = '''
312319
int analyze() {}
313320
''';
314321

322+
final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml'));
323+
optionsFile.writeAsStringSync('''
324+
analyzer:
325+
errors:
326+
missing_return: info
327+
''');
328+
315329
fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode);
316330
await runCommand(
317331
arguments: <String>['analyze', '--no-pub', '--no-fatal-infos'],
@@ -321,13 +335,20 @@ int analyze() {}
321335
],
322336
exitMessageContains: '1 issue found.',
323337
);
324-
}, skip: true); // https://github.com/flutter/flutter/issues/120750
338+
});
325339

326340
testWithoutContext('analyze once only fatal-warnings has info issue finally exit code 0.', () async {
327341
const String infoSourceCode = '''
328342
int analyze() {}
329343
''';
330344

345+
final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml'));
346+
optionsFile.writeAsStringSync('''
347+
analyzer:
348+
errors:
349+
missing_return: info
350+
''');
351+
331352
fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode);
332353
await runCommand(
333354
arguments: <String>['analyze', '--no-pub', '--fatal-warnings', '--no-fatal-infos'],
@@ -337,7 +358,7 @@ int analyze() {}
337358
],
338359
exitMessageContains: '1 issue found.',
339360
);
340-
}, skip: true); // https://github.com/flutter/flutter/issues/120750
361+
});
341362

342363
testWithoutContext('analyze once only fatal-infos has warning issue finally exit code 0.', () async {
343364
const String warningSourceCode = '''

0 commit comments

Comments
 (0)