Skip to content

Fix data from multiple files not applying all fixes #50358

@Piinks

Description

@Piinks

#47941 made it possible to put fix rules in multiple files.

I split up the large fix_data.yaml file in flutter/flutter, but found there are some bugs. Not all of the fixes are being applied.
See flutter/flutter#114192 where we are seeing these issues.

The PR is huge, so here is one simplified test case where we are seeing fixes not working:

in lib/fix_data/cupertino.yaml

  #  !---- This fix is being applied ----!
  # 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'

   #  !---- This fix is NOT being applied ----!
  # 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'

in test_fixes/cupertino.dart (test file)

// Change made in https://github.com/flutter/flutter/pull/41859
CupertinoTextThemeData themeData = CupertinoTextThemeData(brightness: Brightness.dark);
themeData.copyWith(brightness: Brightness.light);
themeData = CupertinoTextThemeData(error: '');
themeData.copyWith(error: '');

in test_fixes/cupertino.dart.expect (expected transformation)

// Change made in https://github.com/flutter/flutter/pull/41859
CupertinoTextThemeData themeData = CupertinoTextThemeData();
themeData.copyWith();
themeData = CupertinoTextThemeData(error: '');
themeData.copyWith(error: '');

Result

// Change made in https://github.com/flutter/flutter/pull/41859
CupertinoTextThemeData themeData = CupertinoTextThemeData(); // <-- Fix worked
themeData.copyWith(brightness: Brightness.light); // <-- Fix did not work
themeData = CupertinoTextThemeData(error: '');
themeData.copyWith(error: '');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions