dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.09k stars 1.56k forks source link

Apply dart fixes to require_trailing_commas #47232

Open bounty1342 opened 3 years ago

bounty1342 commented 3 years ago

Dart SDK Version Dart SDK version: 2.14.0 (stable) (Mon Sep 6 13:47:59 2021 +0200) on "macos_x64"

Reproduction

Add require_trailing_commas to analysis_options.yaml lints
TextStyle get hintTextFiesld => TextStyle(
      color: Colors.grey.shade500, debugLabel: 'lihjiolhoiukllinilobibib');
dart fix --dry-run

Result

Computing fixes in mobile (dry run)... 82.0s
Nothing to fix!

Expected Offers to infer the comma. Display the fix on Fix, Fix.all on Vs code.

asashour commented 2 years ago

https://dart-review.googlesource.com/c/sdk/+/215403

gmaggio commented 1 year ago

I think this is happening again after I upgraded to Flutter 3.13.4.

[✓] Flutter (Channel stable, 3.13.4, on macOS 13.4.1
    22F82 darwin-arm64, locale en-ID)
    • Flutter version 3.13.4 on channel stable at
      /Users/folder/dev/flutter
    • Upstream repository
      https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (5 days ago),
      2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio
      Code.app/Contents
    • Flutter extension version 3.72.0
gmaggio commented 11 months ago

Somehow require_trailing_commas is detected again now. Could this be related to the packages instead, such as flutter_lints? Because my Flutter & Dart versions are still the same. Can't figure out what fixes the issue.

[✓] Flutter (Channel stable, 3.13.4, on macOS 13.4.1 22F82
    darwin-arm64, locale en-ID)
    • Flutter version 3.13.4 on channel stable at
      /Users/folder/dev/flutter
    • Upstream repository
      https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (2 weeks ago), 2023-09-12
      23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0
bwilkerson commented 8 months ago

The require_trailing_commas lint does not appear to be included in flutter_lints. If you mean that the lint appears to be enabled now when it was disabled before, the only way I can think of that that could happen is if it's been added, directly or indirectly, to the analysis options file being used to analyze the code where it's being reported.