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 caf9a5e844..03a27bc8ae 100644 --- a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart +++ b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart @@ -63,7 +63,7 @@ void main() { "name": "flutter_project", "rootUri": "../", "packageUri": "lib/", - "languageVersion": "2.7" + "languageVersion": "2.12" } ] } @@ -170,7 +170,7 @@ void main() { statusTextContains: [ 'Analyzing', 'unused_element', - 'missing_required_param', + 'missing_required_argument', ], exitMessageContains: '2 issues found.', exitCode: 1, @@ -205,7 +205,7 @@ void main() { 'Analyzing', 'unused_element', 'only_throw_errors', - 'missing_required_param', + 'missing_required_argument', ], exitMessageContains: '3 issues found.', exitCode: 1, @@ -266,22 +266,15 @@ StringBuffer bar = StringBuffer('baz'); testWithoutContext('analyze once with default options has info issue finally exit code 1.', () async { const String infoSourceCode = ''' -int analyze() {} +void _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'], statusTextContains: [ 'info', - 'missing_return', + 'unused_element', ], exitMessageContains: '1 issue found.', exitCode: 1, @@ -290,14 +283,14 @@ analyzer: testWithoutContext('analyze once with no-fatal-infos has info issue finally exit code 0.', () async { const String infoSourceCode = ''' -int analyze() {} +void _analyze() {} '''; final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); optionsFile.writeAsStringSync(''' analyzer: errors: - missing_return: info + unused_element: info '''); fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode); @@ -305,7 +298,7 @@ analyzer: arguments: ['analyze', '--no-pub', '--no-fatal-infos'], statusTextContains: [ 'info', - 'missing_return', + 'unused_element', ], exitMessageContains: '1 issue found.', ); @@ -313,14 +306,14 @@ analyzer: testWithoutContext('analyze once only fatal-warnings has info issue finally exit code 0.', () async { const String infoSourceCode = ''' -int analyze() {} +void _analyze() {} '''; final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); optionsFile.writeAsStringSync(''' analyzer: errors: - missing_return: info + unused_element: info '''); fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(infoSourceCode); @@ -328,7 +321,7 @@ analyzer: arguments: ['analyze', '--no-pub', '--fatal-warnings', '--no-fatal-infos'], statusTextContains: [ 'info', - 'missing_return', + 'unused_element', ], exitMessageContains: '1 issue found.', ); @@ -336,14 +329,14 @@ analyzer: testWithoutContext('analyze once only fatal-infos has warning issue finally exit code 0.', () async { const String warningSourceCode = ''' -int analyze() {} +void _analyze() {} '''; final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); optionsFile.writeAsStringSync(''' analyzer: errors: - missing_return: warning + unused_element: warning '''); fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(warningSourceCode); @@ -351,7 +344,7 @@ analyzer: arguments: ['analyze','--no-pub', '--fatal-infos', '--no-fatal-warnings'], statusTextContains: [ 'warning', - 'missing_return', + 'unused_element', ], exitMessageContains: '1 issue found.', ); @@ -360,14 +353,14 @@ analyzer: testWithoutContext('analyze once only fatal-warnings has warning issue finally exit code 1.', () async { const String warningSourceCode = ''' -int analyze() {} +void _analyze() {} '''; final File optionsFile = fileSystem.file(fileSystem.path.join(projectPath, 'analysis_options.yaml')); optionsFile.writeAsStringSync(''' analyzer: errors: - missing_return: warning + unused_element: warning '''); fileSystem.directory(projectPath).childFile('main.dart').writeAsStringSync(warningSourceCode); @@ -375,7 +368,7 @@ analyzer: arguments: ['analyze','--no-pub', '--no-fatal-infos', '--fatal-warnings'], statusTextContains: [ 'warning', - 'missing_return', + 'unused_element', ], exitMessageContains: '1 issue found.', exitCode: 1, @@ -408,7 +401,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title;