diff --git a/analysis_options.yaml b/analysis_options.yaml index 9dfba698..462c5ebd 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -44,6 +44,7 @@ linter: - implementation_imports - library_names - library_prefixes + - no_leading_underscores_for_local_identifiers - non_constant_identifier_names # - one_member_abstracts # - only_throw_errors diff --git a/lib/src/hitmap.dart b/lib/src/hitmap.dart index a80c8f24..326dfa16 100644 --- a/lib/src/hitmap.dart +++ b/lib/src/hitmap.dart @@ -99,7 +99,7 @@ class HitMap { final ignoredLines = ignoredLinesList.iterator; var hasCurrent = ignoredLines.moveNext(); - bool _shouldIgnoreLine(Iterator> ignoredRanges, int line) { + bool shouldIgnoreLine(Iterator> ignoredRanges, int line) { if (!hasCurrent || ignoredRanges.current.isEmpty) { return false; } @@ -138,7 +138,7 @@ class HitMap { final k = hits[i]; if (k is int) { // Single line. - if (_shouldIgnoreLine(ignoredLines, k)) continue; + if (shouldIgnoreLine(ignoredLines, k)) continue; addToMap(hitMap, k, hits[i + 1] as int); } else if (k is String) { @@ -147,7 +147,7 @@ class HitMap { final start = int.parse(k.substring(0, splitPos)); final end = int.parse(k.substring(splitPos + 1)); for (var j = start; j <= end; j++) { - if (_shouldIgnoreLine(ignoredLines, j)) continue; + if (shouldIgnoreLine(ignoredLines, j)) continue; addToMap(hitMap, j, hits[i + 1] as int); } diff --git a/lib/src/resolver.dart b/lib/src/resolver.dart index 9b0e9023..d2e799ca 100644 --- a/lib/src/resolver.dart +++ b/lib/src/resolver.dart @@ -77,13 +77,13 @@ class Resolver { return resolveSymbolicLinks(filePath); } if (uri.scheme == 'package') { - final _packages = this._packages; - if (_packages == null) { + final packages = _packages; + if (packages == null) { return null; } final packageName = uri.pathSegments[0]; - final packageUri = _packages[packageName]; + final packageUri = packages[packageName]; if (packageUri == null) { failed.add('$uri'); return null; diff --git a/lib/src/util.dart b/lib/src/util.dart index a85de49b..dd379ae4 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -13,7 +13,7 @@ Future retry(Future Function() f, Duration interval, {Duration? timeout}) async { var keepGoing = true; - Future _withTimeout(Future Function() f, {Duration? duration}) { + Future withTimeout(Future Function() f, {Duration? duration}) { if (duration == null) { return f(); } @@ -27,7 +27,7 @@ Future retry(Future Function() f, Duration interval, }); } - return _withTimeout(() async { + return withTimeout(() async { while (keepGoing) { try { return await f(); diff --git a/test/lcov_test.dart b/test/lcov_test.dart index 773c46c2..59ff38c4 100644 --- a/test/lcov_test.dart +++ b/test/lcov_test.dart @@ -154,7 +154,7 @@ void main() { // be very careful if you change the test file expect(res, contains(' 0| return a - b;')); - expect(res, contains('| return _withTimeout(() async {'), + expect(res, contains('| return withTimeout(() async {'), reason: 'be careful if you change lib/src/util.dart'); final hitLineRegexp = RegExp(r'\s+(\d+)\| return a \+ b;'); @@ -177,7 +177,7 @@ void main() { // be very careful if you change the test file expect(res, contains(' 0| return a - b;')); - expect(res, contains('| return _withTimeout(() async {'), + expect(res, contains('| return withTimeout(() async {'), reason: 'be careful if you change lib/src/util.dart'); final hitLineRegexp = RegExp(r'\s+(\d+)\| return a \+ b;');