Skip to content

Commit b2618fc

Browse files
authored
[ffigen] auto-ignore unused imports in bindings (#2750)
1 parent 1e6c853 commit b2618fc

File tree

57 files changed

+72
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+72
-83
lines changed

pkgs/ffigen/example/add/lib/add.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// AUTO GENERATED FILE, DO NOT EDIT.
22
//
33
// Generated by `package:ffigen`.
4-
// ignore_for_file: type=lint
4+
// ignore_for_file: type=lint, unused_import
55
import 'dart:ffi' as ffi;
66

77
@ffi.Native<ffi.Int Function(ffi.Int, ffi.Int)>()

pkgs/ffigen/example/c_json/cjson_generated_bindings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// AUTO GENERATED FILE, DO NOT EDIT.
2222
//
2323
// Generated by `package:ffigen`.
24-
// ignore_for_file: type=lint
24+
// ignore_for_file: type=lint, unused_import
2525
import 'dart:ffi' as ffi;
2626

2727
/// Holds bindings to cJSON.

pkgs/ffigen/example/ffinative/lib/generated_bindings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// AUTO GENERATED FILE, DO NOT EDIT.
66
//
77
// Generated by `package:ffigen`.
8-
// ignore_for_file: type=lint
8+
// ignore_for_file: type=lint, unused_import
99
@ffi.DefaultAsset('package:ffinative_example/generated_bindings.dart')
1010
library;
1111

pkgs/ffigen/example/libclang-example/generated_bindings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// AUTO GENERATED FILE, DO NOT EDIT.
77
//
88
// Generated by `package:ffigen`.
9-
// ignore_for_file: type=lint
9+
// ignore_for_file: type=lint, unused_import
1010
import 'custom_import.dart' as custom_import;
1111
import 'dart:ffi' as ffi;
1212

pkgs/ffigen/example/objective_c/avf_audio_bindings.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
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-
// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore.
6-
// ignore_for_file: unused_import
7-
85
// AUTO GENERATED FILE, DO NOT EDIT.
96
//
107
// Generated by `package:ffigen`.
11-
// ignore_for_file: type=lint
8+
// ignore_for_file: type=lint, unused_import
129
import 'dart:ffi' as ffi;
1310
import 'package:objective_c/objective_c.dart' as objc;
1411
import 'package:ffi/ffi.dart' as pkg_ffi;

pkgs/ffigen/example/objective_c/generate_code.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
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+
import 'dart:io';
6+
57
import 'package:ffigen/ffigen.dart';
68
import 'package:logging/logging.dart';
79

@@ -27,16 +29,13 @@ final config = FfiGenerator(
2729

2830
output: Output(
2931
// The Dart file where the bindings will be generated.
30-
dartFile: Uri.file('avf_audio_bindings.dart'),
32+
dartFile: Platform.script.resolve('avf_audio_bindings.dart'),
3133

3234
// Preamble text to put at the top of the generated file.
3335
preamble: '''
3436
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
3537
// for details. All rights reserved. Use of this source code is governed by a
3638
// BSD-style license that can be found in the LICENSE file.
37-
38-
// TODO(https://github.com/dart-lang/native/issues/2748): Remove this ignore.
39-
// ignore_for_file: unused_import
4039
''',
4140
),
4241
);

pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// AUTO GENERATED FILE, DO NOT EDIT.
22
//
33
// Generated by `package:ffigen`.
4-
// ignore_for_file: type=lint
4+
// ignore_for_file: type=lint, unused_import
55
import 'dart:ffi' as ffi;
66

77
/// Bindings to `headers/a.h`.

pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// AUTO GENERATED FILE, DO NOT EDIT.
22
//
33
// Generated by `package:ffigen`.
4-
// ignore_for_file: type=lint
4+
// ignore_for_file: type=lint, unused_import
55
import 'dart:ffi' as ffi;
66
import 'package:shared_bindings/generated/base_gen.dart' as imp$1;
77

pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// AUTO GENERATED FILE, DO NOT EDIT.
22
//
33
// Generated by `package:ffigen`.
4-
// ignore_for_file: type=lint
4+
// ignore_for_file: type=lint, unused_import
55
import 'dart:ffi' as ffi;
66

77
/// Bindings to `headers/base.h`.

pkgs/ffigen/example/simple/generated_bindings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// AUTO GENERATED FILE, DO NOT EDIT.
22
//
33
// Generated by `package:ffigen`.
4-
// ignore_for_file: type=lint
4+
// ignore_for_file: type=lint, unused_import
55
import 'dart:ffi' as ffi;
66

77
/// Bindings to `headers/example.h`.

0 commit comments

Comments
 (0)