Skip to content

Commit ea7ea57

Browse files
Bump dart_style from 2.3.7 to 3.0.0 (#2459)
* Bump dart_style from 2.3.7 to 3.0.0 Bumps [dart_style](https://github.com/dart-lang/dart_style) from 2.3.7 to 3.0.0. - [Release notes](https://github.com/dart-lang/dart_style/releases) - [Changelog](https://github.com/dart-lang/dart_style/blob/main/CHANGELOG.md) - [Commits](dart-lang/dart_style@v2.3.7...v3.0.0) --- updated-dependencies: - dependency-name: dart_style dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update DartFormatter() to explicitly set the language version. This is now required in dart-style v3 * use set the dart version from the Platform library instead of the ananlyzer library because that analyzer library may use beta versions --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Carlos (Goodwine) <2022649+Goodwine@users.noreply.github.com>
1 parent 6f4584c commit ea7ea57

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

lib/src/deprecation.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,17 @@ enum Deprecation {
191191
String toString() => id;
192192

193193
/// Returns the deprecation with a given ID, or null if none exists.
194-
static Deprecation? fromId(String id) => Deprecation.values
195-
.firstWhereOrNull((deprecation) => deprecation.id == id);
194+
static Deprecation? fromId(String id) => Deprecation.values.firstWhereOrNull(
195+
(deprecation) => deprecation.id == id,
196+
);
196197

197198
/// Returns the set of all deprecations done in or before [version].
198199
static Set<Deprecation> forVersion(Version version) {
199200
var range = VersionRange(max: version, includeMax: true);
200201
return {
201202
for (var deprecation in Deprecation.values)
202-
if (deprecation.deprecatedIn.andThen(range.allows) ?? false) deprecation
203+
if (deprecation.deprecatedIn.andThen(range.allows) ?? false)
204+
deprecation,
203205
};
204206
}
205207
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dev_dependencies:
4141
analyzer: ^6.8.0
4242
archive: ^3.1.2
4343
crypto: ^3.0.0
44-
dart_style: ^2.0.0
44+
dart_style: ^3.0.0
4545
dartdoc: ">=8.0.14 <8.3.1" # dart-lang/dartdoc#3947
4646
grinder: ^0.9.0
4747
node_preamble: ^2.0.2

tool/grind/generate_deprecations.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:io';
88
import 'package:crypto/crypto.dart';
99
import 'package:dart_style/dart_style.dart';
1010
import 'package:grinder/grinder.dart';
11+
import 'package:pub_semver/pub_semver.dart';
1112
import 'package:yaml/yaml.dart';
1213

1314
import 'utils.dart';
@@ -78,5 +79,7 @@ void deprecations() {
7879
fail("Couldn't find block for generated code in lib/src/deprecation.dart");
7980
}
8081
var newCode = dartText.replaceFirst(_blockRegex, buffer.toString());
81-
dartFile.writeAsStringSync(DartFormatter().format(newCode));
82+
dartFile.writeAsStringSync(DartFormatter(
83+
languageVersion: Version.parse(Platform.version.split(' ').first))
84+
.format(newCode));
8285
}

tool/grind/synchronize.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'package:crypto/crypto.dart';
1616
import 'package:dart_style/dart_style.dart';
1717
import 'package:grinder/grinder.dart';
1818
import 'package:path/path.dart' as p;
19+
import 'package:pub_semver/pub_semver.dart';
1920
import 'package:source_span/source_span.dart';
2021

2122
import 'package:sass/src/util/nullable.dart';
@@ -58,7 +59,9 @@ String synchronizeFile(String source) {
5859
parseFile(path: source, featureSet: FeatureSet.latestLanguageVersion())
5960
.unit
6061
.accept(visitor);
61-
return DartFormatter().format(visitor.result);
62+
return DartFormatter(
63+
languageVersion: Version.parse(Platform.version.split(' ').first))
64+
.format(visitor.result);
6265
}
6366

6467
/// The visitor that traverses the asynchronous parse tree and converts it to

0 commit comments

Comments
 (0)