diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 86dfe9e2e2..e629a44178 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -10,8 +10,6 @@ analyzer: # Exclude anything that uses package:objective_c, due to flutter dependency. # https://github.com/dart-lang/native/issues/1068 - - example/objective_c/** - - example/swift/** - test_flutter/native_objc_test/** - test/native_objc_test/** language: diff --git a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart index a6889c019e..78bdcbac19 100644 --- a/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart +++ b/pkgs/ffigen/example/c_json/cjson_generated_bindings.dart @@ -18,7 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// ignore_for_file: camel_case_types, non_constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/example/c_json/config.yaml b/pkgs/ffigen/example/c_json/config.yaml index 3d61cbd25f..21891417af 100644 --- a/pkgs/ffigen/example/c_json/config.yaml +++ b/pkgs/ffigen/example/c_json/config.yaml @@ -29,5 +29,3 @@ preamble: | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - - // ignore_for_file: camel_case_types, non_constant_identifier_names \ No newline at end of file diff --git a/pkgs/ffigen/example/ffinative/config.yaml b/pkgs/ffigen/example/ffinative/config.yaml index 2e54ea249a..b21b471c53 100644 --- a/pkgs/ffigen/example/ffinative/config.yaml +++ b/pkgs/ffigen/example/ffinative/config.yaml @@ -13,7 +13,6 @@ preamble: | // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - // ignore_for_file: deprecated_member_use functions: symbol-address: include: diff --git a/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart b/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart index 77ebf960bd..854b395653 100644 --- a/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart +++ b/pkgs/ffigen/example/ffinative/lib/generated_bindings.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore_for_file: deprecated_member_use - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/example/libclang-example/config.yaml b/pkgs/ffigen/example/libclang-example/config.yaml index 7e56f14c50..48945404f4 100644 --- a/pkgs/ffigen/example/libclang-example/config.yaml +++ b/pkgs/ffigen/example/libclang-example/config.yaml @@ -72,5 +72,3 @@ preamble: | // Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - - // ignore_for_file: camel_case_types, non_constant_identifier_names diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart index d9060beb02..a9b98a4295 100644 --- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart +++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart @@ -3,8 +3,6 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// ignore_for_file: camel_case_types, non_constant_identifier_names - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index c865e2c26b..06b51e9ba5 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -2,15 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore_for_file: camel_case_types -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: unused_element -// ignore_for_file: unused_field +// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore. // ignore_for_file: unused_import -// ignore_for_file: void_checks -// ignore_for_file: annotate_overrides -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: library_private_types_in_public_api // AUTO GENERATED FILE, DO NOT EDIT. // diff --git a/pkgs/ffigen/example/objective_c/generate_code.dart b/pkgs/ffigen/example/objective_c/generate_code.dart index f4814f802c..62fe6d7108 100644 --- a/pkgs/ffigen/example/objective_c/generate_code.dart +++ b/pkgs/ffigen/example/objective_c/generate_code.dart @@ -35,15 +35,8 @@ final config = FfiGenerator( // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore_for_file: camel_case_types -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: unused_element -// ignore_for_file: unused_field +// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore. // ignore_for_file: unused_import -// ignore_for_file: void_checks -// ignore_for_file: annotate_overrides -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: library_private_types_in_public_api ''', ), ); diff --git a/pkgs/ffigen/example/objective_c/play_audio.dart b/pkgs/ffigen/example/objective_c/play_audio.dart index 1ec45d6f57..0c402a32e2 100644 --- a/pkgs/ffigen/example/objective_c/play_audio.dart +++ b/pkgs/ffigen/example/objective_c/play_audio.dart @@ -3,17 +3,18 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; + import 'package:objective_c/objective_c.dart'; -import 'avf_audio_bindings.dart'; // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. -import '../../../objective_c/test/setup.dart' as objCSetup; +import '../../../objective_c/test/setup.dart' as objc_setup; +import 'avf_audio_bindings.dart'; const _dylibPath = '/System/Library/Frameworks/AVFAudio.framework/Versions/Current/AVFAudio'; void main(List args) async { - objCSetup.main([]); + objc_setup.main([]); DynamicLibrary.open(_dylibPath); for (final file in args) { final fileStr = NSString(file); diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index 4702162563..bced920489 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -10,6 +10,7 @@ environment: dependencies: args: ^2.6.0 ffi: ^2.0.1 + logging: ^1.3.0 objective_c: ^0.0.1 dev_dependencies: diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml index a23faa18b2..78790dce23 100644 --- a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a.yaml @@ -10,5 +10,3 @@ output: '../lib/generated/a_gen.dart' headers: entry-points: - '../headers/a.h' -preamble: | - // ignore_for_file: non_constant_identifier_names, camel_case_types diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml index aa4f1b10a1..660f4c24b2 100644 --- a/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/a_shared_base.yaml @@ -14,5 +14,3 @@ import: symbol-files: # Both package Uri and file paths are supported here. - 'package:shared_bindings/generated/base_symbols.yaml' -preamble: | - // ignore_for_file: non_constant_identifier_names, camel_case_types diff --git a/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml b/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml index da03542dfa..d69dd26b31 100644 --- a/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml +++ b/pkgs/ffigen/example/shared_bindings/ffigen_configs/base.yaml @@ -15,5 +15,3 @@ output: headers: entry-points: - '../headers/base.h' -preamble: | - // ignore_for_file: non_constant_identifier_names, camel_case_types diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart index c22f5aeb3b..d401a4a579 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart @@ -1,5 +1,3 @@ -// ignore_for_file: non_constant_identifier_names, camel_case_types - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -122,7 +120,7 @@ enum BaseEnum { static BaseEnum fromValue(int value) => switch (value) { 0 => BASE_ENUM_1, 1 => BASE_ENUM_2, - _ => throw ArgumentError("Unknown value for BaseEnum: $value"), + _ => throw ArgumentError('Unknown value for BaseEnum: $value'), }; } @@ -146,7 +144,7 @@ enum A_Enum { static A_Enum fromValue(int value) => switch (value) { 0 => A_ENUM_1, 1 => A_ENUM_2, - _ => throw ArgumentError("Unknown value for A_Enum: $value"), + _ => throw ArgumentError('Unknown value for A_Enum: $value'), }; } diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart index 2f0612ce83..54cb990250 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart @@ -1,5 +1,3 @@ -// ignore_for_file: non_constant_identifier_names, camel_case_types - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart index 95ba329d8d..28ef256694 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart @@ -1,5 +1,3 @@ -// ignore_for_file: non_constant_identifier_names, camel_case_types - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. @@ -70,7 +68,7 @@ enum BaseEnum { static BaseEnum fromValue(int value) => switch (value) { 0 => BASE_ENUM_1, 1 => BASE_ENUM_2, - _ => throw ArgumentError("Unknown value for BaseEnum: $value"), + _ => throw ArgumentError('Unknown value for BaseEnum: $value'), }; } diff --git a/pkgs/ffigen/example/swift/config.yaml b/pkgs/ffigen/example/swift/config.yaml index 74c703df3a..ea5b585327 100644 --- a/pkgs/ffigen/example/swift/config.yaml +++ b/pkgs/ffigen/example/swift/config.yaml @@ -18,8 +18,5 @@ preamble: | // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - // ignore_for_file: camel_case_types, non_constant_identifier_names - // ignore_for_file: unused_element, unused_field, return_of_invalid_type - // ignore_for_file: void_checks, annotate_overrides - // ignore_for_file: no_leading_underscores_for_local_identifiers - // ignore_for_file: library_private_types_in_public_api + // TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore. + // ignore_for_file: unused_import diff --git a/pkgs/ffigen/example/swift/example.dart b/pkgs/ffigen/example/swift/example.dart index 9d007b5ba3..20b5eb81a5 100644 --- a/pkgs/ffigen/example/swift/example.dart +++ b/pkgs/ffigen/example/swift/example.dart @@ -3,14 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; + import 'package:objective_c/objective_c.dart'; -import 'swift_api_bindings.dart'; // TODO(https://github.com/dart-lang/native/issues/1068): Remove this. -import '../../../objective_c/test/setup.dart' as objCSetup; +import '../../../objective_c/test/setup.dart' as objc_setup; +import 'swift_api_bindings.dart'; void main() { - objCSetup.main([]); + objc_setup.main([]); // TODO(https://github.com/dart-lang/ffigen/issues/443): Add a test for this. DynamicLibrary.open('libswiftapi.dylib'); diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index bcbcccea91..6a983dadbe 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -2,11 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// ignore_for_file: camel_case_types, non_constant_identifier_names -// ignore_for_file: unused_element, unused_field, return_of_invalid_type -// ignore_for_file: void_checks, annotate_overrides -// ignore_for_file: no_leading_underscores_for_local_identifiers -// ignore_for_file: library_private_types_in_public_api +// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore. +// ignore_for_file: unused_import // AUTO GENERATED FILE, DO NOT EDIT. // diff --git a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart index 14590cd14a..f600694fdc 100644 --- a/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/pkgs/ffigen/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -3,8 +3,6 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// ignore_for_file: camel_case_types, non_constant_identifier_names - // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. diff --git a/pkgs/ffigen/tool/libclang_config.yaml b/pkgs/ffigen/tool/libclang_config.yaml index 005807d0c6..e5d7ebc2f6 100644 --- a/pkgs/ffigen/tool/libclang_config.yaml +++ b/pkgs/ffigen/tool/libclang_config.yaml @@ -30,8 +30,6 @@ preamble: | // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - // ignore_for_file: camel_case_types, non_constant_identifier_names - enums: include: - CXChildVisitResult