-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work ondevexp-bulk-fixdevexp-quick-fixIssues with analysis server (quick) fixesIssues with analysis server (quick) fixeslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Dart SDK version: 3.7.0-157.0.dev (dev) (Sat Nov 16 12:03:16 2024 -0800) on "windows_x64"
Running dart fix --apply on this code will apply the fixes in b.dart multiple times:
// a.dart
part 'b.dart';
void a() {
// need to trigger a lint in a.dart for the bug to happen
;
b();
}
// b.dart
part of 'a.dart';
Stream<String> b() {
// dart fix should only add a single const
return Stream.empty();
}# analysis_options.yaml
linter:
rules:
- empty_statements
- prefer_const_constructorsThe fix adds const 3 times in b.dart:
part of 'a.dart';
Stream<String> b() {
// dart fix should only add a single const
return const const const Stream.empty();
}Output of dart fix --apply:
Applying fixes...
lib\a.dart
empty_statements • 1 fix
lib\b.dart
prefer_const_constructors • 3 fixes
It's not limited to these lints. For example the fix for require_trailing_commas would add multiple commas.
FMorschel and benthillerkus
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work ondevexp-bulk-fixdevexp-quick-fixIssues with analysis server (quick) fixesIssues with analysis server (quick) fixeslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)