Skip to content

Commit 4c24da9

Browse files
committed
Fix lint checking
1 parent 432403d commit 4c24da9

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
working-directory: packages/isar_test
4444
- name: Lint
4545
run: flutter analyze
46+
working-directory: packages
4647

4748
test_core:
4849
name: Core Test

examples/pub/lib/package_manager.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ class PackageManager {
155155
}
156156

157157
Future<void> loadPackageAssets(String name, String version) {
158-
return compute(loadAssets, PackageAndVersion(name, version));
158+
return compute(
159+
loadAssets,
160+
PackageAndVersion(name, version),
161+
debugLabel: 'load $name assets',
162+
);
159163
}
160164

161165
Future<List<String>> search(String query, int page, {bool online = true}) {

packages/isar/lib/src/generator/isar_type.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ part of isar_generator;
22

33
const TypeChecker _dateTimeChecker = TypeChecker.fromRuntime(DateTime);
44

5-
extension DartTypeX on DartType {
5+
extension on DartType {
66
bool get isDartCoreDateTime =>
77
element != null && _dateTimeChecker.isExactly(element!);
88

packages/isar/lib/src/impl/isar_impl.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class _IsarImpl extends Isar {
152152
final receivePort = ReceivePort();
153153
final sendPort = receivePort.sendPort;
154154
final isolate = runIsolate(
155+
'Isar open async',
155156
() async {
156157
try {
157158
final isar = _IsarImpl.open(
@@ -173,7 +174,6 @@ class _IsarImpl extends Isar {
173174
sendPort.send(e);
174175
}
175176
},
176-
debugName: 'Isar open async',
177177
);
178178

179179
final response = await receivePort.first;
@@ -349,6 +349,7 @@ class _IsarImpl extends Isar {
349349
final library = IsarCore._library;
350350
final schemas = generatedSchemas;
351351
return runIsolate(
352+
debugName ?? 'Isar async read',
352353
() => _isarAsync(
353354
instanceId: instance,
354355
schemas: schemas,
@@ -357,7 +358,6 @@ class _IsarImpl extends Isar {
357358
callback: callback,
358359
library: library,
359360
),
360-
debugName: debugName ?? 'Isar async read',
361361
);
362362
}
363363

@@ -377,6 +377,7 @@ class _IsarImpl extends Isar {
377377
final library = IsarCore._library;
378378
final schemas = generatedSchemas.toList();
379379
return runIsolate(
380+
debugName ?? 'Isar async write',
380381
() {
381382
return _isarAsync(
382383
instanceId: instance,
@@ -387,7 +388,6 @@ class _IsarImpl extends Isar {
387388
library: library,
388389
);
389390
},
390-
debugName: debugName ?? 'Isar async write',
391391
);
392392
}
393393

packages/isar/lib/src/native/native.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ int platformFastHash(String string) {
100100
/// @nodoc
101101
@tryInline
102102
Future<T> runIsolate<T>(
103-
FutureOr<T> Function() computation, {
104-
String? debugName,
105-
}) {
103+
String debugName,
104+
FutureOr<T> Function() computation,
105+
) {
106106
return Isolate.run(computation, debugName: debugName);
107107
}

packages/isar/lib/src/web/web.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ export 'bindings.dart';
1111
export 'ffi.dart';
1212
export 'interop.dart';
1313

14-
Future<R> scheduleIsolate<R>(R Function() callback, {String? debugName}) async {
15-
throw UnimplementedError();
16-
}
17-
1814
FutureOr<IsarCoreBindings> initializePlatformBindings([
1915
String? library,
2016
]) async {
@@ -93,8 +89,8 @@ int platformFastHash(String str) {
9389

9490
@tryInline
9591
Future<T> runIsolate<T>(
96-
FutureOr<T> Function() computation, {
97-
String? debugName,
98-
}) async {
92+
String debugName,
93+
FutureOr<T> Function() computation,
94+
) async {
9995
return computation();
10096
}

0 commit comments

Comments
 (0)