File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 5
5
import 'dart:io' ;
6
6
7
7
import 'package:build/build.dart' ;
8
+ import 'package:dart_style/dart_style.dart' ;
8
9
import 'package:yaml/yaml.dart' ;
9
10
11
+ final formatter = DartFormatter ();
12
+
10
13
// Until we have verification in pkg:build and friends
11
14
// https://github.com/dart-lang/build/issues/590
12
15
Builder validate (String builderName, Builder builder) {
Original file line number Diff line number Diff line change @@ -6,13 +6,10 @@ import 'dart:async';
6
6
import 'dart:collection' ;
7
7
8
8
import 'package:build/build.dart' ;
9
- import 'package:dart_style/dart_style.dart' ;
10
9
import 'package:path/path.dart' as p;
11
10
12
11
import 'shared.dart' ;
13
12
14
- final _formatter = DartFormatter ();
15
-
16
13
Builder testBuilder ([_]) => validate ('_test_builder' , const _TestBuilder ());
17
14
18
15
class _TestBuilder implements Builder {
@@ -56,7 +53,7 @@ class _TestBuilder implements Builder {
56
53
57
54
final content = Replacement .generate (sourceContent, replacements);
58
55
59
- await buildStep.writeAsString (newId, _formatter .format (content));
56
+ await buildStep.writeAsString (newId, formatter .format (content));
60
57
}
61
58
62
59
if (baseName == _kitchenSinkBaseName) {
@@ -73,7 +70,7 @@ class _TestBuilder implements Builder {
73
70
'];' ,
74
71
];
75
72
76
- await buildStep.writeAsString (newId, _formatter .format (lines.join ('\n ' )));
73
+ await buildStep.writeAsString (newId, formatter .format (lines.join ('\n ' )));
77
74
}
78
75
}
79
76
Original file line number Diff line number Diff line change @@ -6,14 +6,11 @@ import 'dart:async';
6
6
7
7
import 'package:build/build.dart' ;
8
8
import 'package:collection/collection.dart' ;
9
- import 'package:dart_style/dart_style.dart' ;
10
9
import 'package:json_serializable/src/type_helpers/map_helper.dart' ;
11
10
12
11
import 'shared.dart' ;
13
12
import 'test_type_data.dart' ;
14
13
15
- final _formatter = DartFormatter ();
16
-
17
14
const _trivialTypesToTest = {
18
15
'BigInt' : TestTypeData .defaultFunc (
19
16
jsonExpression: "'12345'" ,
@@ -128,7 +125,7 @@ class _TypeBuilder implements Builder {
128
125
129
126
await buildStep.writeAsString (
130
127
newId,
131
- _formatter .format (entry.value.libContent (sourceContent, type)),
128
+ formatter .format (entry.value.libContent (sourceContent, type)),
132
129
);
133
130
}
134
131
}
You can’t perform that action at this time.
0 commit comments