Permalink
Browse files

Move constructor definitions to top of classes (#234)

Fixes lint: sort_constructors_first (Sort constructor declarations
before other members).
  • Loading branch information...
cbracken committed Oct 13, 2018
1 parent 4160915 commit 91ea1b16b4004dbdcdb3ab12770f8d3c040955c0
Showing with 17 additions and 16 deletions.
  1. +3 −2 bin/collect_coverage.dart
  2. +8 −8 lib/src/formatter.dart
  3. +6 −6 lib/src/resolver.dart
@@ -34,13 +34,14 @@ Future<Null> main(List<String> arguments) async {
}
class Options {
Options(
this.serviceUri, this.out, this.timeout, this.waitPaused, this.resume);
final Uri serviceUri;
final IOSink out;
final Duration timeout;
final bool waitPaused;
final bool resume;
Options(
this.serviceUri, this.out, this.timeout, this.waitPaused, this.resume);
}
Options _parseArgs(List<String> arguments) {
View
@@ -19,17 +19,17 @@ abstract class Formatter {
/// Returns a [Future] that completes as soon as all map entries have been
/// emitted.
class LcovFormatter implements Formatter {
final Resolver resolver;
final String basePath;
final List<String> reportOn;
/// Creates a new LCOV formatter.
///
/// If [reportOn] is provided, coverage report output is limited to files
/// prefixed with one of the paths included. If [basePath] is provided, paths
/// are reported relative to that path.
LcovFormatter(this.resolver, {this.reportOn, this.basePath});
final Resolver resolver;
final String basePath;
final List<String> reportOn;
@override
Future<String> format(Map hitmap) async {
_PathFilter pathFilter = _getPathFilter(reportOn);
@@ -69,16 +69,16 @@ class LcovFormatter implements Formatter {
/// Returns a [Future] that completes as soon as all map entries have been
/// emitted.
class PrettyPrintFormatter implements Formatter {
final Resolver resolver;
final Loader loader;
final List<String> reportOn;
/// Creates a new pretty-print formatter.
///
/// If [reportOn] is provided, coverage report output is limited to files
/// prefixed with one of the paths included.
PrettyPrintFormatter(this.resolver, this.loader, {this.reportOn});
final Resolver resolver;
final Loader loader;
final List<String> reportOn;
@override
Future<String> format(Map hitmap) async {
_PathFilter pathFilter = _getPathFilter(reportOn);
View
@@ -10,16 +10,16 @@ import 'package:path/path.dart' as p;
/// [Resolver] resolves imports with respect to a given environment.
class Resolver {
Resolver({String packagesPath, this.packageRoot, this.sdkRoot})
: packagesPath = packagesPath,
_packages = packagesPath != null ? _parsePackages(packagesPath) : null;
final String packagesPath;
final String packageRoot;
final String sdkRoot;
final List<String> failed = [];
Map<String, Uri> _packages;
Resolver({String packagesPath, this.packageRoot, this.sdkRoot})
: packagesPath = packagesPath,
_packages = packagesPath != null ? _parsePackages(packagesPath) : null;
/// Returns the absolute path wrt. to the given environment or null, if the
/// import could not be resolved.
String resolve(String scriptUri) {
@@ -92,11 +92,11 @@ class Resolver {
/// Bazel URI resolver.
class BazelResolver extends Resolver {
final String workspacePath;
/// Creates a Bazel resolver with the specified workspace path, if any.
BazelResolver({this.workspacePath: ''});
final String workspacePath;
/// Returns the absolute path wrt. to the given environment or null, if the
/// import could not be resolved.
@override

0 comments on commit 91ea1b1

Please sign in to comment.