Skip to content

upgrade: update dependency dart_style to v3 #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Specify language version
  • Loading branch information
AlexV525 committed Dec 15, 2024
commit e42d40ab4878ce9297dd333f23fb1d224f6b1efb
6 changes: 5 additions & 1 deletion packages/core/lib/flutter_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class FlutterGenerator {
final flutterGen = config.pubspec.flutterGen;
final output = config.pubspec.flutterGen.output;
final lineLength = config.pubspec.flutterGen.lineLength;
final formatter = DartFormatter(pageWidth: lineLength, lineEnding: '\n');
final formatter = DartFormatter(
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: lineLength,
lineEnding: '\n',
);

void defaultWriter(String contents, String path) {
final file = File(path);
Expand Down
5 changes: 4 additions & 1 deletion packages/core/test/assets_gen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ void main() {
final pubspec = File('test_resources/pubspec_assets_no_list.yaml');
final config = loadPubspecConfig(pubspec);
final formatter = DartFormatter(
pageWidth: config.pubspec.flutterGen.lineLength, lineEnding: '\n');
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);

expect(() {
return generateAssets(
Expand Down
10 changes: 8 additions & 2 deletions packages/core/test/colors_gen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ void main() {
final pubspec = File('test_resources/pubspec_colors_no_inputs.yaml');
final config = loadPubspecConfig(pubspec);
final formatter = DartFormatter(
pageWidth: config.pubspec.flutterGen.lineLength, lineEnding: '\n');
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);

expect(() {
return generateColors(
Expand All @@ -35,7 +38,10 @@ void main() {
final pubspec = File('test_resources/pubspec_colors_no_inputs_list.yaml');
final config = loadPubspecConfig(pubspec);
final formatter = DartFormatter(
pageWidth: config.pubspec.flutterGen.lineLength, lineEnding: '\n');
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);

expect(() {
return generateColors(
Expand Down
5 changes: 4 additions & 1 deletion packages/core/test/fonts_gen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ void main() {
File('test_resources/pubspec_fonts_no_family.yaml'),
);
final formatter = DartFormatter(
pageWidth: config.pubspec.flutterGen.lineLength, lineEnding: '\n');
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);

expect(() {
return generateFonts(FontsGenConfig.fromConfig(config), formatter);
Expand Down
3 changes: 3 additions & 0 deletions packages/core/test/gen_test_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Future<List<String>> runAssetsGen(

final config = loadPubspecConfig(pubspecFile, buildFile: buildFile);
final formatter = DartFormatter(
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);
Expand Down Expand Up @@ -73,6 +74,7 @@ Future<List<String>> runColorsGen(
final pubspecFile = File(pubspec);
final config = loadPubspecConfig(pubspecFile);
final formatter = DartFormatter(
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);
Expand Down Expand Up @@ -116,6 +118,7 @@ Future<List<String>> runFontsGen(
final pubspecFile = File(pubspec);
final config = loadPubspecConfig(pubspecFile);
final formatter = DartFormatter(
languageVersion: DartFormatter.latestLanguageVersion,
pageWidth: config.pubspec.flutterGen.lineLength,
lineEnding: '\n',
);
Expand Down
Loading