Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0 - strict cast lint #1290

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkgs/jnigen/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ analyzer:
todo: ignore
exclude: [build/**, example/**]
language:
strict-casts: false # TODO(https://github.com/dart-lang/native/issues/1282): Fix.
strict-inference: true
strict-raw-types: true

Expand Down
1 change: 1 addition & 0 deletions pkgs/jnigen/example/in_app_java/lib/android_utils.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
1 change: 1 addition & 0 deletions pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
1 change: 1 addition & 0 deletions pkgs/jnigen/lib/src/bindings/dart_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ import "package:jni/jni.dart" as jni;
// Sort alphabetically.
static const defaultLintSuppressions = '''
// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
8 changes: 4 additions & 4 deletions pkgs/jnigen/lib/src/config/config_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class Config {
try {
final symbolsFile = File.fromUri(yamlUri);
final content = symbolsFile.readAsStringSync();
yaml = loadYaml(content, sourceUrl: yamlUri);
yaml = loadYaml(content, sourceUrl: yamlUri) as YamlMap;
} on UnsupportedError catch (_) {
log.fatal('Could not reference "$import".');
} catch (e, s) {
Expand Down Expand Up @@ -401,9 +401,9 @@ class Config {
binaryName: binaryName,
)
..path = '$importPath/$filePath'
..finalName = decl['name']
..typeClassName = decl['type_class']
..superCount = decl['super_count']
..finalName = decl['name'] as String
..typeClassName = decl['type_class'] as String
..superCount = decl['super_count'] as int
..allTypeParams = []
..parent = null;
for (final typeParamEntry
Expand Down
8 changes: 4 additions & 4 deletions pkgs/jnigen/lib/src/config/yaml_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class YamlReader {
}

final results = parser.parse(args);
if (results['help']) {
if (results['help'] as bool) {
stderr.writeln(parser.usage);
exit(1);
}
Expand All @@ -57,8 +57,8 @@ class YamlReader {
}
final regex = RegExp('([a-z-_.]+)=(.+)');
final properties = <String, String>{};
for (var prop in results['override']) {
final match = regex.matchAsPrefix(prop as String);
for (var prop in results['override'] as List<String>) {
final match = regex.matchAsPrefix(prop);
if (match != null && match.group(0) == prop) {
final propertyName = match.group(1);
final propertyValue = match.group(2);
Expand All @@ -68,7 +68,7 @@ class YamlReader {
}
}
final config = cli_config.Config.fromConfigFileContents(
commandLineDefines: results['override'],
commandLineDefines: results['override'] as List<String>,
workingDirectory: Directory.current.uri,
environment: Platform.environment,
fileContents: configFileContents,
Expand Down
2 changes: 1 addition & 1 deletion pkgs/jnigen/lib/src/elements/elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Classes implements Element<Classes> {
factory Classes.fromJson(List<dynamic> json) {
final decls = <String, ClassDecl>{};
for (final declJson in json) {
final classDecl = ClassDecl.fromJson(declJson);
final classDecl = ClassDecl.fromJson(declJson as Map<String, dynamic>);
decls[classDecl.binaryName] = classDecl;
}
return Classes(decls);
Expand Down
2 changes: 1 addition & 1 deletion pkgs/jnigen/lib/src/summary/summary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ Future<Classes> getSummary(Config config) async {
if (json == null) {
throw SummaryParseException('Expected JSON element from summarizer.');
}
final classes = Classes.fromJson(json);
final classes = Classes.fromJson(json as List<dynamic>);
return classes;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
1 change: 1 addition & 0 deletions pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Autogenerated by jnigen. DO NOT EDIT!

// ignore_for_file: annotate_overrides
// ignore_for_file: argument_type_not_assignable
// ignore_for_file: camel_case_extensions
// ignore_for_file: camel_case_types
// ignore_for_file: constant_identifier_names
Expand Down
Loading