fix lints
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:drift/drift.dart' show Variable;
|
||||
import 'package:drift/native.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:riverpod/riverpod.dart';
|
||||
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
||||
import 'package:weblibre/domain/services/favicon_resolver.dart';
|
||||
@@ -222,23 +221,26 @@ final _generatorResult = IconResult(
|
||||
);
|
||||
|
||||
final _cachedSvgBytes = Uint8List.fromList(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">'
|
||||
'<rect width="16" height="16" fill="#ff0000"/>'
|
||||
'</svg>'
|
||||
'''
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<rect width="16" height="16" fill="#ff0000"/>
|
||||
</svg>'''
|
||||
.codeUnits,
|
||||
);
|
||||
|
||||
final _updatedSvgBytes = Uint8List.fromList(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">'
|
||||
'<circle cx="8" cy="8" r="8" fill="#0000ff"/>'
|
||||
'</svg>'
|
||||
'''
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<circle cx="8" cy="8" r="8" fill="#0000ff"/>
|
||||
</svg>'''
|
||||
.codeUnits,
|
||||
);
|
||||
|
||||
final _generatedSvgBytes = Uint8List.fromList(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">'
|
||||
'<rect width="16" height="16" rx="3" fill="#5B8DEF"/>'
|
||||
'<text x="8" y="11" text-anchor="middle" font-size="8" fill="#fff">W</text>'
|
||||
'</svg>'
|
||||
'''
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<rect width="16" height="16" rx="3" fill="#5B8DEF"/>
|
||||
<text x="8" y="11" text-anchor="middle" font-size="8" fill="#fff">W</text>
|
||||
</svg>'''
|
||||
.codeUnits,
|
||||
);
|
||||
|
||||
+5
-3
@@ -83,19 +83,21 @@ void main() {
|
||||
tester.binding.handleAppLifecycleStateChanged(AppLifecycleState.resumed);
|
||||
await tester.pump();
|
||||
|
||||
expect(repository.refreshCount, 1);
|
||||
expect(repository.refreshCount(), 1);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeSubscriptionRepository extends SubscriptionRepository {
|
||||
int refreshCount = 0;
|
||||
int _refreshCount = 0;
|
||||
|
||||
int refreshCount() => _refreshCount;
|
||||
|
||||
@override
|
||||
Future<SubscriptionStatus> build() async => SubscriptionStatus.inactive;
|
||||
|
||||
@override
|
||||
Future<void> refresh() async {
|
||||
refreshCount++;
|
||||
_refreshCount++;
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -18,8 +18,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
|
||||
-1
@@ -12,7 +12,6 @@ import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:mockito/src/dummies.dart' as _i5;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: deprecated_member_use
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// ignore_for_file: avoid_redundant_argument_values, avoid_dynamic_calls
|
||||
// ignore_for_file: avoid_dynamic_calls
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
-1
@@ -12,7 +12,6 @@ import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:mockito/src/dummies.dart' as _i5;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: deprecated_member_use
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ void main() {
|
||||
test(
|
||||
'container assignments ensure sing-box profiles are running before syncing',
|
||||
() async {
|
||||
final profileId = SingboxProxyConnectionId('profile-1');
|
||||
const profileId = SingboxProxyConnectionId('profile-1');
|
||||
final assignedContainer = _container(
|
||||
id: 'container-1',
|
||||
contextId: 'context-a',
|
||||
|
||||
-1
@@ -439,7 +439,6 @@ void main() {
|
||||
UrlCleanerRule(
|
||||
name: 'test',
|
||||
data: UrlCleanerRuleData(
|
||||
// ignore: avoid_redundant_argument_values
|
||||
completeProvider: false,
|
||||
urlPattern: r'^https?://example\.com',
|
||||
rules: ['track'],
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ void main() {
|
||||
color: Colors.blue,
|
||||
orderKey: 'a',
|
||||
metadata: ContainerMetadata.withDefaults(
|
||||
proxyConnectionId: SingboxProxyConnectionId('missing-proxy'),
|
||||
proxyConnectionId: const SingboxProxyConnectionId('missing-proxy'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
+1
-1
@@ -438,7 +438,7 @@ class _FakeContainerRepository extends ContainerRepository {
|
||||
|
||||
class _FakeProxyRoutingSettingsRepository
|
||||
extends ProxyRoutingSettingsRepository {
|
||||
ProxyRoutingSettings? _settings;
|
||||
final ProxyRoutingSettings? _settings;
|
||||
|
||||
_FakeProxyRoutingSettingsRepository([this._settings]);
|
||||
|
||||
|
||||
@@ -127,16 +127,18 @@ void main() {
|
||||
test('buildGroupedParentTree creates correct hierarchy', () {
|
||||
final registry = _makeRegistry();
|
||||
final tree = registry.buildGroupedParentTree();
|
||||
final defaultGroup = tree[UBlockAssetGroup.$default];
|
||||
final adsGroup = tree[UBlockAssetGroup.ads];
|
||||
|
||||
expect(tree, contains(UBlockAssetGroup.$default));
|
||||
expect(tree[UBlockAssetGroup.$default]!, contains('uBlock filters'));
|
||||
expect(defaultGroup, contains('uBlock filters'));
|
||||
expect(
|
||||
tree[UBlockAssetGroup.$default]!['uBlock filters'],
|
||||
defaultGroup?['uBlock filters'],
|
||||
containsAll(['ublock-filters', 'ublock-privacy']),
|
||||
);
|
||||
expect(tree, contains(UBlockAssetGroup.ads));
|
||||
expect(tree[UBlockAssetGroup.ads]!, contains(null));
|
||||
expect(tree[UBlockAssetGroup.ads]![null], contains('easylist'));
|
||||
expect(adsGroup, contains(null));
|
||||
expect(adsGroup?[null], contains('easylist'));
|
||||
expect(tree, contains(UBlockAssetGroup.regions));
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ void main() {
|
||||
);
|
||||
|
||||
test('forces animations off when the app setting is enabled', () {
|
||||
// ignore: avoid_redundant_argument_values
|
||||
const mediaQuery = MediaQueryData(disableAnimations: false);
|
||||
|
||||
final result = applyAppMediaQueryOverrides(
|
||||
|
||||
@@ -3,9 +3,9 @@ import 'dart:typed_data';
|
||||
|
||||
import 'package:drift/native.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
||||
import 'package:weblibre/domain/services/favicon_resolver.dart';
|
||||
@@ -128,7 +128,7 @@ void main() {
|
||||
|
||||
final class _NeverCalledResolver implements FaviconResolver {
|
||||
@override
|
||||
Future<FaviconResolveResult> resolve(Uri url, {int? proxyPort}) async {
|
||||
Future<FaviconResolveResult> resolve(Uri url, {int? proxyPort}) {
|
||||
throw UnimplementedError('cacheOnly should not hit the resolver');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user