Skip to content

Commit c4dba24

Browse files
committed
dartfmt
1 parent 785395a commit c4dba24

File tree

9 files changed

+93
-31
lines changed

9 files changed

+93
-31
lines changed

lib/src/generate/build_impl.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ class BuildImpl {
237237
// Test runner uses a `data` scheme, don't invalidate for those.
238238
if (uri.path.contains('package:test')) return;
239239
continue unknownUri;
240-
unknownUri: default:
240+
unknownUri:
241+
default:
241242
_logger.info('Unrecognized uri scheme `${uri.scheme}` found for '
242243
'library in build script, falling back on full rebuild.');
243244
if (!completer.isCompleted) completer.complete(true);

lib/src/generate/build_result.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ $stackTrace
4747
}
4848

4949
/// The status of a build.
50-
enum BuildStatus { success, failure, }
50+
enum BuildStatus {
51+
success,
52+
failure,
53+
}
5154

5255
/// The type of a build.
5356
enum BuildType { incremental, full }

lib/src/package_graph/package_graph.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class PackageGraph {
2828
addDeps(dep);
2929
}
3030
}
31+
3132
addDeps(root);
3233

3334
return new PackageGraph._(root, allPackages);

test/analyzer/resolver_test.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ void main() {
6666
group('Resolver', () {
6767
test('should handle initial files', () {
6868
return validateResolver(
69-
inputs: {'a|web/main.dart': ' main() {}',},
69+
inputs: {
70+
'a|web/main.dart': ' main() {}',
71+
},
7072
validator: (resolver) {
7173
var source = (_resolvers.lastResolved as dynamic).sources[
7274
toBarbackAssetId(entryPoint)];
@@ -242,8 +244,15 @@ void main() {
242244
},
243245
validator: (resolver) {
244246
var libs = resolver.libraries.where((l) => !l.isInSdk);
245-
expect(libs.map((l) => l.name),
246-
unorderedEquals(['a.main', 'a.a', 'a.b', 'a.c', 'a.d',]));
247+
expect(
248+
libs.map((l) => l.name),
249+
unorderedEquals([
250+
'a.main',
251+
'a.a',
252+
'a.b',
253+
'a.c',
254+
'a.d',
255+
]));
247256
});
248257
});
249258

test/builder/transformer_builder_test.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ void main() {
1818
final phases = new PhaseGroup.singleAction(
1919
copyTransformerBuilder, new InputSet('a', ['web/*.txt']));
2020

21-
testPhases(phases, {'a|web/a.txt': 'a',},
22-
outputs: {'a|web/a.txt.copy': 'a',});
21+
testPhases(phases, {
22+
'a|web/a.txt': 'a',
23+
}, outputs: {
24+
'a|web/a.txt.copy': 'a',
25+
});
2326
});
2427
}
2528

test/generate/build_test.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,13 @@ void main() {
9292
phases.newPhase()
9393
..addAction(new CopyBuilder(), new InputSet('a', ['lib/a.txt']));
9494

95-
await testPhases(phases, {'a|lib/a.txt': 'a', 'a|lib/b.txt': 'b',},
96-
outputs: {'a|lib/a.txt.copy': 'a', 'a|lib/b.txt.copy': 'b',});
95+
await testPhases(phases, {
96+
'a|lib/a.txt': 'a',
97+
'a|lib/b.txt': 'b',
98+
}, outputs: {
99+
'a|lib/a.txt.copy': 'a',
100+
'a|lib/b.txt.copy': 'b',
101+
});
97102
});
98103
});
99104

@@ -283,7 +288,10 @@ void main() {
283288
'a|lib/b.txt.copy.clone': 'b',
284289
'a|$assetGraphPath': JSON.encode(graph.serialize()),
285290
},
286-
outputs: {'a|lib/a.txt.copy': 'b', 'a|lib/a.txt.copy.clone': 'b',},
291+
outputs: {
292+
'a|lib/a.txt.copy': 'b',
293+
'a|lib/a.txt.copy.clone': 'b',
294+
},
287295
writer: writer);
288296
});
289297

test/generate/serve_test.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ void main() {
4949
ChangeType.MODIFY, path.absolute('a', 'web', 'a.txt')));
5050

5151
result = await nextResult(results);
52-
checkOutputs({'a|web/a.txt.copy': 'b',}, result, writer.assets);
52+
checkOutputs({
53+
'a|web/a.txt.copy': 'b',
54+
}, result, writer.assets);
5355
});
5456

5557
test('blocks serving files until the build is done', () async {
@@ -96,7 +98,9 @@ void main() {
9698
await wait(250);
9799
buildBlocker2.complete();
98100
result = await nextResult(results);
99-
checkOutputs({'a|web/a.txt.copy': 'b',}, result, writer.assets);
101+
checkOutputs({
102+
'a|web/a.txt.copy': 'b',
103+
}, result, writer.assets);
100104

101105
/// Make sure we actually see the final request finish.
102106
return done.future;

test/generate/watch_test.dart

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@ void main() {
3838
.listen(results.add);
3939

4040
var result = await nextResult(results);
41-
checkOutputs({'a|web/a.txt.copy': 'a',}, result, writer.assets);
41+
checkOutputs({
42+
'a|web/a.txt.copy': 'a',
43+
}, result, writer.assets);
4244

4345
await writer.writeAsString(makeAsset('a|web/a.txt', 'b'));
4446
FakeWatcher.notifyWatchers(new WatchEvent(
4547
ChangeType.MODIFY, path.absolute('a', 'web', 'a.txt')));
4648

4749
result = await nextResult(results);
48-
checkOutputs({'a|web/a.txt.copy': 'b',}, result, writer.assets);
50+
checkOutputs({
51+
'a|web/a.txt.copy': 'b',
52+
}, result, writer.assets);
4953
});
5054

5155
test('rebuilds on new files', () async {
@@ -55,28 +59,39 @@ void main() {
5559
.listen(results.add);
5660

5761
var result = await nextResult(results);
58-
checkOutputs({'a|web/a.txt.copy': 'a',}, result, writer.assets);
62+
checkOutputs({
63+
'a|web/a.txt.copy': 'a',
64+
}, result, writer.assets);
5965

6066
await writer.writeAsString(makeAsset('a|web/b.txt', 'b'));
6167
FakeWatcher.notifyWatchers(
6268
new WatchEvent(ChangeType.ADD, path.absolute('a', 'web', 'b.txt')));
6369

6470
result = await nextResult(results);
65-
checkOutputs({'a|web/b.txt.copy': 'b',}, result, writer.assets);
71+
checkOutputs({
72+
'a|web/b.txt.copy': 'b',
73+
}, result, writer.assets);
6674
// Previous outputs should still exist.
6775
expect(writer.assets[makeAssetId('a|web/a.txt.copy')].value, 'a');
6876
});
6977

7078
test('rebuilds on deleted files', () async {
7179
var writer = new InMemoryAssetWriter();
7280
var results = <BuildResult>[];
73-
startWatch(copyAPhaseGroup, {'a|web/a.txt': 'a', 'a|web/b.txt': 'b',},
81+
startWatch(
82+
copyAPhaseGroup,
83+
{
84+
'a|web/a.txt': 'a',
85+
'a|web/b.txt': 'b',
86+
},
7487
writer)
7588
.listen(results.add);
7689

7790
var result = await nextResult(results);
78-
checkOutputs({'a|web/a.txt.copy': 'a', 'a|web/b.txt.copy': 'b',},
79-
result, writer.assets);
91+
checkOutputs({
92+
'a|web/a.txt.copy': 'a',
93+
'a|web/b.txt.copy': 'b',
94+
}, result, writer.assets);
8095

8196
await writer.delete(makeAssetId('a|web/a.txt'));
8297
FakeWatcher.notifyWatchers(new WatchEvent(
@@ -101,8 +116,10 @@ void main() {
101116
.listen(results.add);
102117

103118
var result = await nextResult(results);
104-
checkOutputs({'a|web/a.txt.copy': 'a', 'a|web/b.txt.copy': 'b',},
105-
result, writer.assets);
119+
checkOutputs({
120+
'a|web/a.txt.copy': 'a',
121+
'a|web/b.txt.copy': 'b',
122+
}, result, writer.assets);
106123

107124
await writer.writeAsString(makeAsset('a|web/c.txt', 'c'));
108125
FakeWatcher.notifyWatchers(
@@ -136,7 +153,9 @@ void main() {
136153
.listen(results.add);
137154

138155
var result = await nextResult(results);
139-
checkOutputs({'a|web/a.txt.copy': 'a',}, result, writer.assets);
156+
checkOutputs({
157+
'a|web/a.txt.copy': 'a',
158+
}, result, writer.assets);
140159

141160
/// Pretend like a part of the dart script got updated.
142161
await writer.writeAsString(makeAsset('test|lib/test.dart', ''),
@@ -167,7 +186,9 @@ void main() {
167186
var result = await nextResult(results);
168187
// Should ignore the files under the `b` package, even though they
169188
// match the input set.
170-
checkOutputs({'a|web/a.txt.copy': 'a',}, result, writer.assets);
189+
checkOutputs({
190+
'a|web/a.txt.copy': 'a',
191+
}, result, writer.assets);
171192

172193
await writer.writeAsString(makeAsset('a|web/a.txt', 'b'));
173194
await writer.writeAsString(makeAsset('b|web/b.txt', 'c'));
@@ -179,7 +200,9 @@ void main() {
179200
result = await nextResult(results);
180201
// Ignores the modification under the `b` package, even though it
181202
// matches the input set.
182-
checkOutputs({'a|web/a.txt.copy': 'b',}, result, writer.assets);
203+
checkOutputs({
204+
'a|web/a.txt.copy': 'b',
205+
}, result, writer.assets);
183206
});
184207

185208
test('converts packages paths to absolute ones', () async {
@@ -189,14 +212,18 @@ void main() {
189212
.listen(results.add);
190213

191214
var result = await nextResult(results);
192-
checkOutputs({'a|lib/a.txt.copy': 'a',}, result, writer.assets);
215+
checkOutputs({
216+
'a|lib/a.txt.copy': 'a',
217+
}, result, writer.assets);
193218

194219
await writer.writeAsString(makeAsset('a|lib/a.txt', 'b'));
195220
FakeWatcher.notifyWatchers(new WatchEvent(
196221
ChangeType.MODIFY, path.absolute('a', 'packages', 'a', 'a.txt')));
197222

198223
result = await nextResult(results);
199-
checkOutputs({'a|lib/a.txt.copy': 'b',}, result, writer.assets);
224+
checkOutputs({
225+
'a|lib/a.txt.copy': 'b',
226+
}, result, writer.assets);
200227
});
201228
});
202229

@@ -296,17 +323,21 @@ void main() {
296323
startWatch(phases, {'a|web/a.txt': 'a'}, writer).listen(results.add);
297324

298325
var result = await nextResult(results);
299-
checkOutputs({'a|web/a.txt.copy': 'a', 'a|web/a.txt.copy.copy': 'a',},
300-
result, writer.assets);
326+
checkOutputs({
327+
'a|web/a.txt.copy': 'a',
328+
'a|web/a.txt.copy.copy': 'a',
329+
}, result, writer.assets);
301330

302331
await writer.delete(makeAssetId('a|web/a.txt.copy'));
303332
FakeWatcher.notifyWatchers(new WatchEvent(
304333
ChangeType.REMOVE, path.absolute('a', 'web', 'a.txt.copy')));
305334

306335
result = await nextResult(results);
307336
// Should rebuild the generated asset and its outputs.
308-
checkOutputs({'a|web/a.txt.copy': 'a', 'a|web/a.txt.copy.copy': 'a',},
309-
result, writer.assets);
337+
checkOutputs({
338+
'a|web/a.txt.copy': 'a',
339+
'a|web/a.txt.copy.copy': 'a',
340+
}, result, writer.assets);
310341
});
311342
});
312343

test/transformer/transformer_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ void main() {
9898
new BuilderTransformer([new CopyBuilder()])
9999
]
100100
],
101-
{'a|web/a.txt': 'hello',},
101+
{
102+
'a|web/a.txt': 'hello',
103+
},
102104
{'a|web/a.txt.copy': 'hello'},
103105
expectBarbackErrors: true);
104106

0 commit comments

Comments
 (0)