[License] Enable avoid_positional_boolean_parameters lint (#7275)

This commit is contained in:
Chris Bracken
2018-12-20 16:05:43 -08:00
committed by GitHub
parent b07753badc
commit eaffc462ae
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
Signature: acd8a02ea76b205ea2dbea4c91961320
Signature: c3d53eebec5b6c8992029095408c2d8c
+1 -1
View File
@@ -51,7 +51,7 @@ linter:
- avoid_init_to_null
# - avoid_js_rounded_ints # only useful when targeting JS runtime
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested
- avoid_positional_boolean_parameters
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
+5 -3
View File
@@ -13,6 +13,7 @@ import 'dart:math' as math;
import 'package:args/args.dart';
import 'package:crypto/crypto.dart' as crypto;
import 'package:licenses/patterns.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path;
import 'filesystem.dart' as fs;
@@ -1181,13 +1182,13 @@ class _RepositoryDirectory extends _RepositoryEntry implements LicenseSource {
final List<License> licenses = file.licenses;
assert(licenses != null && licenses.isNotEmpty);
result.addAll(licenses);
progress.advance(true);
progress.advance(success: true);
} catch (e, stack) {
system.stderr.writeln('error searching for copyright in: ${file.io}\n$e');
if (e is! String)
system.stderr.writeln(stack);
system.stderr.writeln('\n');
progress.advance(false);
progress.advance(success: false);
}
}
}
@@ -2137,7 +2138,8 @@ class _Progress {
update();
}
}
void advance(bool success) {
void advance({@required bool success}) {
assert(success != null);
if (success)
_withLicense += 1;
else