From 1b8b430e97de269941f60025a0a66964c93e3ea8 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 14 Feb 2024 12:31:08 -0800 Subject: [PATCH] Disable deprecation warnings for mega_gallery (#143466) Follow-up to https://github.com/flutter/flutter/pull/143347. As https://github.com/flutter/flutter/pull/143403 uncovered, deprecation warnings were still enabled for the mega_gallery because it doesn't use the analysis_options.yaml file from the flutter root. This change injects a analysis_options.yaml file for the mega_gallery that disables those warnings. Submitting this separately from https://github.com/flutter/flutter/pull/143403 in case it affects the mega_gallery benchmark to get a clean new baseline before removing all the `deprecated_member_use` ignores. --- dev/tools/mega_gallery.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dev/tools/mega_gallery.dart b/dev/tools/mega_gallery.dart index f75315d97016..340fc61c4585 100644 --- a/dev/tools/mega_gallery.dart +++ b/dev/tools/mega_gallery.dart @@ -85,8 +85,16 @@ void main(List args) { pubspec = pubspec.replaceAll('../../packages/flutter', '../../../packages/flutter'); _file(out, 'pubspec.yaml').writeAsStringSync(pubspec); - // Remove the (flutter_gallery specific) analysis_options.yaml file. - _file(out, 'analysis_options.yaml').deleteSync(); + // Replace the (flutter_gallery specific) analysis_options.yaml file with a default one. + _file(out, 'analysis_options.yaml').writeAsStringSync( + ''' +analyzer: + errors: + # See analysis_options.yaml in the flutter root for context. + deprecated_member_use: ignore + deprecated_member_use_from_same_package: ignore +''' + ); _file(out, '.dartignore').writeAsStringSync('');