diff --git a/analysis_options.yaml b/analysis_options.yaml index 4a4006398a..823215daa7 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -42,6 +42,7 @@ analyzer: # see https://github.com/dart-lang/sdk/issues/28463 - "lib/i18n/messages_*.dart" - "lib/src/http/**" + - "test_fixes/**" linter: rules: diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 2ac702a1d4..2a9d49f27c 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -644,6 +644,18 @@ Future _runFrameworkTests() async { } } + Future runFixTests() async { + final List args = [ + 'fix', + '--compare-to-golden', + ]; + await runCommand( + dart, + args, + workingDirectory: path.join(flutterRoot, 'packages', 'flutter', 'test_fixes'), + ); + } + Future runPrivateTests() async { final List args = [ 'run', @@ -702,6 +714,7 @@ Future _runFrameworkTests() async { options: ['--enable-vmservice'], tableData: bigqueryApi?.tabledata, ); + await runFixTests(); await runPrivateTests(); const String httpClientWarning = 'Warning: At least one test in this suite creates an HttpClient. When\n' diff --git a/packages/flutter/lib/fix_data.yaml b/packages/flutter/lib/fix_data.yaml new file mode 100644 index 0000000000..cf74e8612a --- /dev/null +++ b/packages/flutter/lib/fix_data.yaml @@ -0,0 +1,36 @@ +# Copyright 2014 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# TODO(Piinks): Add link to public user guide when available. + +# Please add new fixes to the top of the file, separated by one blank line +# from other fixes. In a comment, include a link to the PR where the change +# requiring the fix was made. + +version: 1 +transforms: + + # Changes made in https://github.com/flutter/flutter/pull/41859 + - title: 'Remove brightness' + date: 2020-12-10 + element: + uris: [ 'cupertino.dart' ] + constructor: '' + inClass: 'CupertinoTextThemeData' + changes: + - kind: 'removeParameter' + name: 'brightness' + + # Changes made in https://github.com/flutter/flutter/pull/41859 + - title: 'Remove brightness' + date: 2020-12-10 + element: + uris: [ 'cupertino.dart' ] + method: 'copyWith' + inClass: 'CupertinoTextThemeData' + changes: + - kind: 'removeParameter' + name: 'brightness' + +# Before adding a new fix: read instructions at the top of this file. diff --git a/packages/flutter/lib/src/cupertino/text_theme.dart b/packages/flutter/lib/src/cupertino/text_theme.dart index 77f0b92334..d632f49c95 100644 --- a/packages/flutter/lib/src/cupertino/text_theme.dart +++ b/packages/flutter/lib/src/cupertino/text_theme.dart @@ -124,12 +124,6 @@ class CupertinoTextThemeData with Diagnosticable { /// unspecified. const CupertinoTextThemeData({ Color primaryColor = CupertinoColors.systemBlue, - // ignore: avoid_unused_constructor_parameters, the parameter is deprecated. - @Deprecated( - 'This argument no longer does anything. You can remove it. ' - 'This feature was deprecated after v1.10.14.' - ) - Brightness? brightness, TextStyle? textStyle, TextStyle? actionTextStyle, TextStyle? tabLabelTextStyle, @@ -230,11 +224,6 @@ class CupertinoTextThemeData with Diagnosticable { /// specified overrides. CupertinoTextThemeData copyWith({ Color? primaryColor, - @Deprecated( - 'This argument no longer does anything. You can remove it. ' - 'This feature was deprecated after v1.10.14.' - ) - Brightness? brightness, TextStyle? textStyle, TextStyle? actionTextStyle, TextStyle? tabLabelTextStyle, diff --git a/packages/flutter/test_fixes/.dartignore b/packages/flutter/test_fixes/.dartignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/flutter/test_fixes/analysis_options.yaml b/packages/flutter/test_fixes/analysis_options.yaml new file mode 100644 index 0000000000..7cca7b1d5c --- /dev/null +++ b/packages/flutter/test_fixes/analysis_options.yaml @@ -0,0 +1 @@ +# This ensures that parent analysis options do not accidentally break the fix tests. diff --git a/packages/flutter/test_fixes/cupertino.dart b/packages/flutter/test_fixes/cupertino.dart new file mode 100644 index 0000000000..43a88c199c --- /dev/null +++ b/packages/flutter/test_fixes/cupertino.dart @@ -0,0 +1,11 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/cupertino.dart'; + +void main() { + // Change made in https://github.com/flutter/flutter/pull/41859 + const CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark); + themeData.copyWith(brightness: Brightness.light); +} diff --git a/packages/flutter/test_fixes/cupertino.dart.expect b/packages/flutter/test_fixes/cupertino.dart.expect new file mode 100644 index 0000000000..aa6b9fa58c --- /dev/null +++ b/packages/flutter/test_fixes/cupertino.dart.expect @@ -0,0 +1,11 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/cupertino.dart'; + +void main() { + // Change made in https://github.com/flutter/flutter/pull/41859 + const CupertinoTextThemeData themeData = CupertinoTextThemeData(); + themeData.copyWith(); +}