From a664f08a56d16510d101921837b0523edf64d635 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Wed, 15 Feb 2023 09:21:49 -0800 Subject: [PATCH] In test of --(no-)fatal-infos analyzer flags, pin missing_return to info (#120797) * In test of --(no-)fatal-infos analyzer flags, pin missing_return to info * Remove trailing spaces --- .../integration.shard/analyze_once_test.dart | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart index f169b87d9a..8fc3b849db 100644 --- a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart +++ b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart @@ -295,6 +295,13 @@ StringBuffer bar = StringBuffer('baz'); int analyze() {} '''; + final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); + optionsFile.writeAsStringSync(''' +analyzer: + errors: + missing_return: info + '''); + fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode); await runCommand( arguments: ['analyze', '--no-pub'], @@ -305,13 +312,20 @@ int analyze() {} exitMessageContains: '1 issue found.', exitCode: 1, ); - }, skip: true); // https://github.com/flutter/flutter/issues/120750 + }); testWithoutContext('analyze once with no-fatal-infos has info issue finally exit code 0.', () async { const String infoSourceCode = ''' int analyze() {} '''; + final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); + optionsFile.writeAsStringSync(''' +analyzer: + errors: + missing_return: info + '''); + fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode); await runCommand( arguments: ['analyze', '--no-pub', '--no-fatal-infos'], @@ -321,13 +335,20 @@ int analyze() {} ], exitMessageContains: '1 issue found.', ); - }, skip: true); // https://github.com/flutter/flutter/issues/120750 + }); testWithoutContext('analyze once only fatal-warnings has info issue finally exit code 0.', () async { const String infoSourceCode = ''' int analyze() {} '''; + final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); + optionsFile.writeAsStringSync(''' +analyzer: + errors: + missing_return: info + '''); + fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode); await runCommand( arguments: ['analyze', '--no-pub', '--fatal-warnings', '--no-fatal-infos'], @@ -337,7 +358,7 @@ int analyze() {} ], exitMessageContains: '1 issue found.', ); - }, skip: true); // https://github.com/flutter/flutter/issues/120750 + }); testWithoutContext('analyze once only fatal-infos has warning issue finally exit code 0.', () async { const String warningSourceCode = '''