Skip to content

Commit 1e0e9db

Browse files
authored
[jnigen] Switch to package:dart_flutter_team_lints (#1279)
1 parent 091fc34 commit 1e0e9db

File tree

10 files changed

+76
-47
lines changed

10 files changed

+76
-47
lines changed

pkgs/jni/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
## 0.7.2
9090

9191
- Fixed a bug where reading non-null terminated strings would overflow.
92+
- Use `package:dart_flutter_team_lints`.
9293

9394
## 0.7.1
9495

pkgs/jni/analysis_options.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
include: package:flutter_lints/flutter.yaml
1+
include: package:dart_flutter_team_lints/analysis_options.yaml
22

33
analyzer:
44
errors:
55
todo: ignore
66
exclude: [build/**, third_party/**]
77
language:
8+
strict-casts: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
9+
strict-inference: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
810
strict-raw-types: true
911

1012
linter:
1113
rules:
12-
- dangling_library_doc_comments
13-
- prefer_final_locals
14-
- prefer_const_declarations
15-
# Additional information about this file can be found at
16-
# https://dart.dev/guides/language/analysis-options
14+
dangling_library_doc_comments: true
15+
prefer_final_locals: true
16+
prefer_const_declarations: true
17+
avoid_catching_errors: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
18+
avoid_dynamic_calls: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
19+
collection_methods_unrelated_type: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
20+
comment_references: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
21+
directives_ordering: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
22+
lines_longer_than_80_chars: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
23+
omit_local_variable_types: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
24+
only_throw_errors: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
25+
prefer_relative_imports: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
26+
prefer_single_quotes: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
27+
type_annotate_public_apis: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
28+
unnecessary_parenthesis: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
29+
unreachable_from_main: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
30+
use_super_parameters: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.

pkgs/jni/example/pubspec.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ packages:
200200
path: ".."
201201
relative: true
202202
source: path
203-
version: "0.9.3-wip"
203+
version: "0.9.3"
204204
js:
205205
dependency: transitive
206206
description:
@@ -213,18 +213,18 @@ packages:
213213
dependency: transitive
214214
description:
215215
name: leak_tracker
216-
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
216+
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
217217
url: "https://pub.dev"
218218
source: hosted
219-
version: "10.0.4"
219+
version: "10.0.5"
220220
leak_tracker_flutter_testing:
221221
dependency: transitive
222222
description:
223223
name: leak_tracker_flutter_testing
224-
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
224+
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
225225
url: "https://pub.dev"
226226
source: hosted
227-
version: "3.0.3"
227+
version: "3.0.5"
228228
leak_tracker_testing:
229229
dependency: transitive
230230
description:
@@ -261,18 +261,18 @@ packages:
261261
dependency: transitive
262262
description:
263263
name: material_color_utilities
264-
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
264+
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
265265
url: "https://pub.dev"
266266
source: hosted
267-
version: "0.8.0"
267+
version: "0.11.1"
268268
meta:
269269
dependency: transitive
270270
description:
271271
name: meta
272-
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
272+
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
273273
url: "https://pub.dev"
274274
source: hosted
275-
version: "1.12.0"
275+
version: "1.15.0"
276276
mime:
277277
dependency: transitive
278278
description:
@@ -309,10 +309,10 @@ packages:
309309
dependency: transitive
310310
description:
311311
name: platform
312-
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
312+
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
313313
url: "https://pub.dev"
314314
source: hosted
315-
version: "3.1.4"
315+
version: "3.1.5"
316316
plugin_platform_interface:
317317
dependency: transitive
318318
description:
@@ -450,26 +450,26 @@ packages:
450450
dependency: "direct dev"
451451
description:
452452
name: test
453-
sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073"
453+
sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e"
454454
url: "https://pub.dev"
455455
source: hosted
456-
version: "1.25.2"
456+
version: "1.25.7"
457457
test_api:
458458
dependency: transitive
459459
description:
460460
name: test_api
461-
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
461+
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
462462
url: "https://pub.dev"
463463
source: hosted
464-
version: "0.7.0"
464+
version: "0.7.2"
465465
test_core:
466466
dependency: transitive
467467
description:
468468
name: test_core
469-
sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4"
469+
sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696"
470470
url: "https://pub.dev"
471471
source: hosted
472-
version: "0.6.0"
472+
version: "0.6.4"
473473
typed_data:
474474
dependency: transitive
475475
description:
@@ -490,10 +490,10 @@ packages:
490490
dependency: transitive
491491
description:
492492
name: vm_service
493-
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
493+
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
494494
url: "https://pub.dev"
495495
source: hosted
496-
version: "14.2.1"
496+
version: "14.2.4"
497497
watcher:
498498
dependency: transitive
499499
description:

pkgs/jni/lib/jni.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ library jni;
6262

6363
export 'dart:ffi' show nullptr;
6464

65-
export 'package:ffi/ffi.dart' show using, Arena;
65+
export 'package:ffi/ffi.dart' show Arena, using;
6666

6767
export 'src/errors.dart';
6868
export 'src/jarray.dart';

pkgs/jni/pubspec.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ environment:
1919
flutter: '>=2.11.0'
2020

2121
dependencies:
22+
args: ^2.3.1
2223
collection: ^1.0.0
23-
plugin_platform_interface: ^2.0.2
2424
ffi: ^2.0.1
25-
path: ^1.8.0
2625
package_config: ^2.1.0
27-
args: ^2.3.1
26+
path: ^1.8.0
27+
plugin_platform_interface: ^2.0.2
2828

2929
dev_dependencies:
30+
dart_flutter_team_lints: ^2.0.0
3031
## Pin ffigen version because we are depending on internal APIs.
3132
ffigen: 8.0.2
3233
flutter_lints: ^2.0.0
33-
test: ^1.21.1
3434
logging: ^1.1.1
35+
test: ^1.21.1
3536

3637
# The following section is specific to Flutter packages.
3738
flutter:

pkgs/jni/test/load_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@Tags(['load_test'])
6+
library;
67

78
import 'dart:io';
89
import 'dart:ffi';

pkgs/jnigen/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.10.0-wip
22

33
- Added support for Kotlin's top-level functions and fields.
4+
- Use `package:dart_flutter_team_lints`.
45

56
## 0.9.3
67

pkgs/jnigen/analysis_options.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,34 @@
22
# for details. All rights reserved. Use of this source code is governed by a
33
# BSD-style license that can be found in the LICENSE file.
44

5-
include: package:lints/recommended.yaml
5+
include: package:dart_flutter_team_lints/analysis_options.yaml
66

77
analyzer:
88
errors:
99
todo: ignore
1010
exclude: [build/**, example/**]
1111
language:
12-
strict-raw-types: true
12+
strict-casts: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
1313
strict-inference: true
14+
strict-raw-types: true
1415

1516
linter:
1617
rules:
17-
- dangling_library_doc_comments
18-
- prefer_final_locals
19-
- prefer_const_declarations
20-
- unawaited_futures
21-
- prefer_const_constructors
22-
- prefer_relative_imports
18+
dangling_library_doc_comments: true
19+
prefer_final_locals: true
20+
prefer_const_declarations: true
21+
unawaited_futures: true
22+
prefer_const_constructors: true
23+
prefer_relative_imports: true
24+
avoid_catching_errors: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
25+
comment_references: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
26+
directives_ordering: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
27+
library_annotations: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
28+
lines_longer_than_80_chars: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
29+
omit_local_variable_types: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
30+
only_throw_errors: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
31+
prefer_single_quotes: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
32+
type_annotate_public_apis: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
33+
unnecessary_lambdas: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
34+
unnecessary_parenthesis: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
35+
unreachable_from_main: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.

pkgs/jnigen/lib/tools.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library jnigen_tools;
6-
75
export 'src/tools/tools.dart';

pkgs/jnigen/pubspec.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ topics:
1818
- jni
1919

2020
dependencies:
21+
args: ^2.3.0
22+
cli_config: '>=0.1.0 <0.3.0'
2123
json_annotation: ^4.8.0
24+
logging: ^1.0.2
25+
meta: ^1.8.0
2226
package_config: ^2.1.0
2327
path: ^1.8.0
2428
pub_semver: ^2.1.4
25-
args: ^2.3.0
2629
yaml: ^3.1.0
27-
logging: ^1.0.2
28-
meta: ^1.8.0
29-
cli_config: '>=0.1.0 <0.3.0'
3030

3131
dev_dependencies:
32-
lints: ^3.0.0
32+
build_runner: ^2.2.0
33+
dart_flutter_team_lints: ^2.0.0
3334
jni:
3435
path: ../jni
35-
test: ^1.24.1
36-
build_runner: ^2.2.0
3736
json_serializable: ^6.6.0
37+
test: ^1.24.1

0 commit comments

Comments
 (0)