Skip to content

Commit eab1265

Browse files
[pigeon] Reduces lint rules ignored in generated Dart code (#11230)
When I landed #11149, which changes the `ignore_for_file` to use `type=lint`, I didn't examine the list of lint rules we _used to_ violate. In particular, since #11114 and #11163 landed, our generated code no longer violates the following rules: * unnecessary_parenthesis * prefer_null_aware_operators * unnecessary_import * no_leading_underscores_for_local_identifiers I believe this does not need CHANGELOG notes because users should not be using the _hidden_ 'ignore-lints' flag. This list of individually ignored lint rules should only appear in our tests or our checked-in generated Dart files. ## Pre-Review Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] page, which explains my responsibilities. - [x] I read and followed the [relevant style guides] and ran [the auto-formatter]. - [x] I signed the [CLA]. - [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]` - [ ] I [linked to at least one issue that this PR fixes] in the description above. - [x] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1]. - [ ] I updated/added any relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1]. - [x] All existing and new tests are passing. Co-authored-by: stuartmorgan-g <stuartmorgan@google.com>
1 parent 4f94ee2 commit eab1265

15 files changed

+16
-18
lines changed

packages/pigeon/example/app/lib/src/event_channel_messages.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Autogenerated from Pigeon, do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66
// ignore_for_file: unused_import, unused_shown_name
7-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
7+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
88

99
import 'dart:async';
1010
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/example/app/lib/src/messages.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Autogenerated from Pigeon, do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66
// ignore_for_file: unused_import, unused_shown_name
7-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
7+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
88

99
import 'dart:async';
1010
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/lib/src/dart/dart_generator.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,8 @@ class DartGenerator extends StructuredGenerator<InternalDartOptions> {
159159
// in our own checked-in generated files.
160160
indent.writeln(
161161
'// ignore_for_file: public_member_api_docs, '
162-
'non_constant_identifier_names, avoid_as, unnecessary_parenthesis, '
163-
'prefer_null_aware_operators, omit_local_variable_types, '
164-
'omit_obvious_local_variable_types, unnecessary_import, '
165-
'no_leading_underscores_for_local_identifiers',
162+
'non_constant_identifier_names, avoid_as, omit_local_variable_types, '
163+
'omit_obvious_local_variable_types',
166164
);
167165
}
168166
indent.newln();

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/event_channel_tests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/event_channel_without_classes_tests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Autogenerated from Pigeon, do not edit directly.
66
// See also: https://pub.dev/packages/pigeon
77
// ignore_for_file: unused_import, unused_shown_name
8-
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unnecessary_import, no_leading_underscores_for_local_identifiers
8+
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, omit_local_variable_types, omit_obvious_local_variable_types
99

1010
import 'dart:async';
1111
import 'dart:typed_data' show Float64List, Int32List, Int64List;

0 commit comments

Comments
 (0)