Skip to content

Commit eaffc46

Browse files
authored
[License] Enable avoid_positional_boolean_parameters lint (#7275)
1 parent b07753b commit eaffc46

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎ci/licenses_golden/tool_signature‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Signature: acd8a02ea76b205ea2dbea4c91961320
1+
Signature: c3d53eebec5b6c8992029095408c2d8c
22

‎tools/licenses/analysis_options.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ linter:
5151
- avoid_init_to_null
5252
# - avoid_js_rounded_ints # only useful when targeting JS runtime
5353
- avoid_null_checks_in_equality_operators
54-
# - avoid_positional_boolean_parameters # not yet tested
54+
- avoid_positional_boolean_parameters
5555
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
5656
- avoid_relative_lib_imports
5757
- avoid_renaming_method_parameters

‎tools/licenses/lib/main.dart‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'dart:math' as math;
1313
import 'package:args/args.dart';
1414
import 'package:crypto/crypto.dart' as crypto;
1515
import 'package:licenses/patterns.dart';
16+
import 'package:meta/meta.dart';
1617
import 'package:path/path.dart' as path;
1718

1819
import 'filesystem.dart' as fs;
@@ -1181,13 +1182,13 @@ class _RepositoryDirectory extends _RepositoryEntry implements LicenseSource {
11811182
final List<License> licenses = file.licenses;
11821183
assert(licenses != null && licenses.isNotEmpty);
11831184
result.addAll(licenses);
1184-
progress.advance(true);
1185+
progress.advance(success: true);
11851186
} catch (e, stack) {
11861187
system.stderr.writeln('error searching for copyright in: ${file.io}\n$e');
11871188
if (e is! String)
11881189
system.stderr.writeln(stack);
11891190
system.stderr.writeln('\n');
1190-
progress.advance(false);
1191+
progress.advance(success: false);
11911192
}
11921193
}
11931194
}
@@ -2137,7 +2138,8 @@ class _Progress {
21372138
update();
21382139
}
21392140
}
2140-
void advance(bool success) {
2141+
void advance({@required bool success}) {
2142+
assert(success != null);
21412143
if (success)
21422144
_withLicense += 1;
21432145
else

0 commit comments

Comments
 (0)