Skip to content

Commit 2259e10

Browse files
srawlinscopybara-github
authored andcommitted
Pass a Dart language version to the Dart formatter.
This will be required in an upcoming version of the Dart formatter. PiperOrigin-RevId: 673452282
1 parent d7a8334 commit 2259e10

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Require Dart >= 3.3.0.
77
* Require analyzer 6.4.1.
88
* Add support for extension types.
9+
* Require dart_style >= 2.3.7, so that the current Dart language version can be
10+
passed to `DartFormatter`.
911

1012
## 5.4.4
1113

lib/src/builder.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ class MockBuilder implements Builder {
144144
// The source lib may be pre-null-safety because of an explicit opt-out
145145
// (`// @dart=2.9`), as opposed to living in a pre-null-safety package. To
146146
// allow for this situation, we must also add an opt-out comment here.
147-
final mockLibraryContent = DartFormatter().format('''
147+
final mockLibraryContent =
148+
DartFormatter(languageVersion: DartFormatter.latestLanguageVersion)
149+
.format('''
148150
// Mocks generated by Mockito $packageVersion from annotations
149151
// in ${entryLib.definingCompilationUnit.source.uri.path}.
150152
// Do not manually edit this file.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
build: ^2.0.0
1414
code_builder: ^4.5.0
1515
collection: ^1.15.0
16-
dart_style: ^2.0.0
16+
dart_style: ^2.3.7
1717
matcher: ^0.12.15
1818
meta: ^1.3.0
1919
path: ^1.8.0

0 commit comments

Comments
 (0)