-
Notifications
You must be signed in to change notification settings - Fork 66
Update dart_style to pass in a language version to DartFormatter. #466
Conversation
We're in [the process of](dart-lang/dart_style#1403) moving dart_style to [a new formatting style](dart-lang/dart_style#1253). That involves making the formatter [aware of the language version of what it's formatting](dart-lang/dart_style#1402). That in turn means that the library API now lets you pass in a language version. In dart_style 2.3.7 [you can pass in a language version but the parameter is optional](https://pub.dev/documentation/dart_style/latest/dart_style/DartFormatter/DartFormatter.html). In the forthcoming 3.0.0 release, that parameter will become mandatory. This updates every call to `DartFormatter()` to pass in the latest language version. If there's a more specific version that should be used, let me know and I'll update the PR. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add in a line to the latest changelog entry? Something like Upgrade to dart_style 2.3.7.
.
Also, it looks like there is an existing analysis issue w/ the analysis_options.yaml file; it would be great to address that as well, so that we can land this PR on green.
From your PR description and the code change, it looks like we're fine w/o this change as the upcoming api break is in the next major version of dart_style; but perhaps this makes it easier to roll that new version into a monorepo w/ this package.
Done.
Sure thing, done.
Yeah, you don't need to pass the language version in just to please 2.3.7, but you will to work with 3.0.0 which is hot on its heels.
Yes, that's the motivation for me fixing this. :) |
@devoncarew, in order to get CI happy, I had to bump the stable version being tested to 3.3.0. Are you OK with that? It should be fine since, after this change, anyone using the latest code_builder will need to be on 3.3.0 or later anyway (since it appears there is no version of analyzer that dart_style 2.3.7 accepts which allows an older SDK. |
Yes, we're generally fine w/ moving sdk deps forward as necessary, up to and including the latest stable. |
…rt-archive/code_builder#466) * Update dart_style to pass in a language version to DartFormatter. We're in [the process of](dart-lang/dart_style#1403) moving dart_style to [a new formatting style](dart-lang/dart_style#1253). That involves making the formatter [aware of the language version of what it's formatting](dart-lang/dart_style#1402). That in turn means that the library API now lets you pass in a language version. In dart_style 2.3.7 [you can pass in a language version but the parameter is optional](https://pub.dev/documentation/dart_style/latest/dart_style/DartFormatter/DartFormatter.html). In the forthcoming 3.0.0 release, that parameter will become mandatory. This updates every call to `DartFormatter()` to pass in the latest language version. * Update CHANGELOG and analysis_options.yaml. * Require Dart SDK 3.5.0.
We're in the process of moving dart_style to a new formatting style. That involves making the formatter aware of the language version of what it's formatting.
That in turn means that the library API now lets you pass in a language version. In dart_style 2.3.7 you can pass in a language version but the parameter is optional. In the forthcoming 3.0.0 release, that parameter will become mandatory.
This updates every call to
DartFormatter()
to pass in the latest language version. If there's a more specific version that should be used, let me know and I'll update the PR.Thanks!