File tree 4 files changed +14
-6
lines changed
4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -191,15 +191,17 @@ enum Deprecation {
191
191
String toString () => id;
192
192
193
193
/// 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
+ );
196
197
197
198
/// Returns the set of all deprecations done in or before [version] .
198
199
static Set <Deprecation > forVersion (Version version) {
199
200
var range = VersionRange (max: version, includeMax: true );
200
201
return {
201
202
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,
203
205
};
204
206
}
205
207
}
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ dev_dependencies:
41
41
analyzer : ^6.8.0
42
42
archive : ^3.1.2
43
43
crypto : ^3.0.0
44
- dart_style : ^2 .0.0
44
+ dart_style : ^3 .0.0
45
45
dartdoc : " >=8.0.14 <8.3.1" # dart-lang/dartdoc#3947
46
46
grinder : ^0.9.0
47
47
node_preamble : ^2.0.2
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import 'dart:io';
8
8
import 'package:crypto/crypto.dart' ;
9
9
import 'package:dart_style/dart_style.dart' ;
10
10
import 'package:grinder/grinder.dart' ;
11
+ import 'package:pub_semver/pub_semver.dart' ;
11
12
import 'package:yaml/yaml.dart' ;
12
13
13
14
import 'utils.dart' ;
@@ -78,5 +79,7 @@ void deprecations() {
78
79
fail ("Couldn't find block for generated code in lib/src/deprecation.dart" );
79
80
}
80
81
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));
82
85
}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import 'package:crypto/crypto.dart';
16
16
import 'package:dart_style/dart_style.dart' ;
17
17
import 'package:grinder/grinder.dart' ;
18
18
import 'package:path/path.dart' as p;
19
+ import 'package:pub_semver/pub_semver.dart' ;
19
20
import 'package:source_span/source_span.dart' ;
20
21
21
22
import 'package:sass/src/util/nullable.dart' ;
@@ -58,7 +59,9 @@ String synchronizeFile(String source) {
58
59
parseFile (path: source, featureSet: FeatureSet .latestLanguageVersion ())
59
60
.unit
60
61
.accept (visitor);
61
- return DartFormatter ().format (visitor.result);
62
+ return DartFormatter (
63
+ languageVersion: Version .parse (Platform .version.split (' ' ).first))
64
+ .format (visitor.result);
62
65
}
63
66
64
67
/// The visitor that traverses the asynchronous parse tree and converts it to
You can’t perform that action at this time.
0 commit comments