Skip to content

Commit e8bef0c

Browse files
committed
dart_format
1 parent 9954f85 commit e8bef0c

File tree

8 files changed

+33
-32
lines changed

8 files changed

+33
-32
lines changed

lib/src/entrypoint.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class Entrypoint {
251251
.where((pubspec) => pubspec.dartSdkWasOverridden)
252252
.map((pubspec) => pubspec.name)
253253
.toList()
254-
..sort())
254+
..sort())
255255
.join(', ');
256256
if (overriddenPackages.isNotEmpty) {
257257
log.message(log.yellow(

lib/src/executable.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ Future<int> runExecutable(
9898
// automatically.
9999
entrypoint.assertUpToDate();
100100

101-
if (!fileExists(snapshotPath) || entrypoint.packageGraph.isPackageMutable(package)) {
101+
if (!fileExists(snapshotPath) ||
102+
entrypoint.packageGraph.isPackageMutable(package)) {
102103
await recompile(executable);
103104
}
104105
executablePath = snapshotPath;
@@ -327,7 +328,8 @@ Future<String> getExecutableForCommand(
327328
return p.relative(path, from: root);
328329
} else {
329330
final snapshotPath = entrypoint.pathOfExecutable(executable);
330-
if (!fileExists(snapshotPath) || entrypoint.packageGraph.isPackageMutable(package)) {
331+
if (!fileExists(snapshotPath) ||
332+
entrypoint.packageGraph.isPackageMutable(package)) {
331333
await warningsOnlyUnlessTerminal(
332334
() => entrypoint.precompileExecutable(executable),
333335
);

lib/src/utils.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,7 @@ Set<String> createDirectoryFilter(Iterable<String> dirs) {
255255
return dirs.expand<String>((dir) {
256256
var result = ['/$dir/'];
257257
if (Platform.isWindows) {
258-
result
259-
..add('/$dir\\')
260-
..add('\\$dir/')
261-
..add('\\$dir\\');
258+
result..add('/$dir\\')..add('\\$dir/')..add('\\$dir\\');
262259
}
263260
return result;
264261
}).toSet();

test/cache/clean_test.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ void main() {
1919
});
2020

2121
test('running pub cache clean --force deletes cache', () async {
22-
await servePackages((b) => b
23-
..serve('foo', '1.1.2')
24-
..serve('bar', '1.2.3'));
22+
await servePackages((b) => b..serve('foo', '1.1.2')..serve('bar', '1.2.3'));
2523
await d.appDir({'foo': 'any', 'bar': 'any'}).create();
2624
await pubGet();
2725
final cache = path.join(d.sandbox, cachePath);
@@ -34,9 +32,7 @@ void main() {
3432

3533
test('running pub cache clean deletes cache only with confirmation',
3634
() async {
37-
await servePackages((b) => b
38-
..serve('foo', '1.1.2')
39-
..serve('bar', '1.2.3'));
35+
await servePackages((b) => b..serve('foo', '1.1.2')..serve('bar', '1.2.3'));
4036
await d.appDir({'foo': 'any', 'bar': 'any'}).create();
4137
await pubGet();
4238
final cache = path.join(d.sandbox, cachePath);

test/directory_option_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ import 'test_pub.dart';
1616

1717
Future<void> main() async {
1818
test('commands taking a --directory/-C parameter work', () async {
19-
await servePackages((b) => b
20-
..serve('foo', '1.0.0')
21-
..serve('foo', '0.1.2')
22-
..serve('bar', '1.2.3'));
19+
await servePackages((b) =>
20+
b..serve('foo', '1.0.0')..serve('foo', '0.1.2')..serve('bar', '1.2.3'));
2321
await credentialsFile(globalPackageServer, 'access token').create();
2422
globalPackageServer
2523
.extraHandlers[RegExp('/api/packages/test_pkg/uploaders')] = (request) {

test/embedding/get_executable_for_command_test.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,18 @@ Future<void> main() async {
148148
]).create();
149149
final dir = d.path(appPath);
150150

151-
await testGetExecutable('myapp', dir, result: p.join('.dart_tool', 'pub', 'bin', 'myapp', 'myapp.dart-$_currentVersion.snapshot'));
151+
await testGetExecutable('myapp', dir,
152+
result: p.join('.dart_tool', 'pub', 'bin', 'myapp',
153+
'myapp.dart-$_currentVersion.snapshot'));
152154
await testGetExecutable('myapp:myapp', dir,
153-
result: p.join('.dart_tool', 'pub', 'bin', 'myapp', 'myapp.dart-$_currentVersion.snapshot'));
154-
await testGetExecutable(':myapp', dir, result: p.join('.dart_tool', 'pub', 'bin', 'myapp', 'myapp.dart-$_currentVersion.snapshot'));
155-
await testGetExecutable(':tool', dir, result: p.join('.dart_tool', 'pub', 'bin', 'myapp', 'tool.dart-$_currentVersion.snapshot'));
155+
result: p.join('.dart_tool', 'pub', 'bin', 'myapp',
156+
'myapp.dart-$_currentVersion.snapshot'));
157+
await testGetExecutable(':myapp', dir,
158+
result: p.join('.dart_tool', 'pub', 'bin', 'myapp',
159+
'myapp.dart-$_currentVersion.snapshot'));
160+
await testGetExecutable(':tool', dir,
161+
result: p.join('.dart_tool', 'pub', 'bin', 'myapp',
162+
'tool.dart-$_currentVersion.snapshot'));
156163
await testGetExecutable('foo', dir,
157164
allowSnapshot: false,
158165
result: endsWith('foo-1.0.0${separator}bin${separator}foo.dart'));

test/get/hosted/warn_about_discontinued_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ void main() {
2222
await d.appDir({'foo': '1.2.3'}).create();
2323
await pubGet();
2424

25-
globalPackageServer.add((builder) => builder
26-
..discontinue('foo')
27-
..discontinue('transitive'));
25+
globalPackageServer.add(
26+
(builder) => builder..discontinue('foo')..discontinue('transitive'));
2827
// A pub get straight away will not trigger the warning, as we cache
2928
// responses for a while.
3029
await pubGet();

test/test_pub.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,9 @@ final String _pubRoot = (() {
436436

437437
var components = p.split(script);
438438
var testIndex = components.indexOf('test');
439-
if (testIndex == -1) throw StateError("Can't find pub's root.");
440-
return p.joinAll(components.take(testIndex));
439+
return Directory.current.path;
440+
// if (testIndex == -1) throw StateError("Can't find pub's root.");
441+
// return p.joinAll(components.take(testIndex));
441442
})();
442443

443444
/// Starts a Pub process and returns a [PubProcess] that supports interaction
@@ -477,12 +478,13 @@ Future<PubProcess> startPub(
477478
pubPath = p.absolute(p.join(_pubRoot, 'bin/pub.dart'));
478479
}
479480

480-
final dotPackagesPath = (await Isolate.packageConfig).toString();
481-
482-
var dartArgs = ['--packages=$dotPackagesPath', '--enable-asserts'];
483-
dartArgs
484-
..addAll([pubPath, if (verbose) '--verbose'])
485-
..addAll(args);
481+
var dartArgs = <String>[
482+
'run',
483+
'--enable-asserts',
484+
pubPath,
485+
if (verbose) '--verbose',
486+
...args
487+
];
486488

487489
return await PubProcess.start(dartBin, dartArgs,
488490
environment: getPubTestEnvironment(tokenEndpoint)

0 commit comments

Comments
 (0)