Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 91ea1b1

Browse files
authored
Move constructor definitions to top of classes (#234)
Fixes lint: sort_constructors_first (Sort constructor declarations before other members).
1 parent 4160915 commit 91ea1b1

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

bin/collect_coverage.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ Future<Null> main(List<String> arguments) async {
3434
}
3535

3636
class Options {
37+
Options(
38+
this.serviceUri, this.out, this.timeout, this.waitPaused, this.resume);
39+
3740
final Uri serviceUri;
3841
final IOSink out;
3942
final Duration timeout;
4043
final bool waitPaused;
4144
final bool resume;
42-
Options(
43-
this.serviceUri, this.out, this.timeout, this.waitPaused, this.resume);
4445
}
4546

4647
Options _parseArgs(List<String> arguments) {

lib/src/formatter.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ abstract class Formatter {
1919
/// Returns a [Future] that completes as soon as all map entries have been
2020
/// emitted.
2121
class LcovFormatter implements Formatter {
22-
final Resolver resolver;
23-
final String basePath;
24-
final List<String> reportOn;
25-
2622
/// Creates a new LCOV formatter.
2723
///
2824
/// If [reportOn] is provided, coverage report output is limited to files
2925
/// prefixed with one of the paths included. If [basePath] is provided, paths
3026
/// are reported relative to that path.
3127
LcovFormatter(this.resolver, {this.reportOn, this.basePath});
3228

29+
final Resolver resolver;
30+
final String basePath;
31+
final List<String> reportOn;
32+
3333
@override
3434
Future<String> format(Map hitmap) async {
3535
_PathFilter pathFilter = _getPathFilter(reportOn);
@@ -69,16 +69,16 @@ class LcovFormatter implements Formatter {
6969
/// Returns a [Future] that completes as soon as all map entries have been
7070
/// emitted.
7171
class PrettyPrintFormatter implements Formatter {
72-
final Resolver resolver;
73-
final Loader loader;
74-
final List<String> reportOn;
75-
7672
/// Creates a new pretty-print formatter.
7773
///
7874
/// If [reportOn] is provided, coverage report output is limited to files
7975
/// prefixed with one of the paths included.
8076
PrettyPrintFormatter(this.resolver, this.loader, {this.reportOn});
8177

78+
final Resolver resolver;
79+
final Loader loader;
80+
final List<String> reportOn;
81+
8282
@override
8383
Future<String> format(Map hitmap) async {
8484
_PathFilter pathFilter = _getPathFilter(reportOn);

lib/src/resolver.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import 'package:path/path.dart' as p;
1010

1111
/// [Resolver] resolves imports with respect to a given environment.
1212
class Resolver {
13+
Resolver({String packagesPath, this.packageRoot, this.sdkRoot})
14+
: packagesPath = packagesPath,
15+
_packages = packagesPath != null ? _parsePackages(packagesPath) : null;
16+
1317
final String packagesPath;
1418
final String packageRoot;
1519
final String sdkRoot;
1620
final List<String> failed = [];
1721
Map<String, Uri> _packages;
1822

19-
Resolver({String packagesPath, this.packageRoot, this.sdkRoot})
20-
: packagesPath = packagesPath,
21-
_packages = packagesPath != null ? _parsePackages(packagesPath) : null;
22-
2323
/// Returns the absolute path wrt. to the given environment or null, if the
2424
/// import could not be resolved.
2525
String resolve(String scriptUri) {
@@ -92,11 +92,11 @@ class Resolver {
9292

9393
/// Bazel URI resolver.
9494
class BazelResolver extends Resolver {
95-
final String workspacePath;
96-
9795
/// Creates a Bazel resolver with the specified workspace path, if any.
9896
BazelResolver({this.workspacePath: ''});
9997

98+
final String workspacePath;
99+
100100
/// Returns the absolute path wrt. to the given environment or null, if the
101101
/// import could not be resolved.
102102
@override

0 commit comments

Comments
 (0)