Skip to content

Commit 3e31d48

Browse files
authored
Support analyzer 6.6.0 (#266)
1 parent 519c5dd commit 3e31d48

Some content is hidden

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

55 files changed

+443
-233
lines changed

all_lint_rules.yaml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ linter:
33
- always_declare_return_types
44
- always_put_control_body_on_new_line
55
- always_put_required_named_parameters_first
6-
- always_require_non_null_named_parameters
76
- always_specify_types
87
- always_use_package_imports
98
- annotate_overrides
9+
- annotate_redeclares
1010
- avoid_annotating_with_dynamic
1111
- avoid_bool_literals_in_conditional_expressions
1212
- avoid_catches_without_on_clauses
@@ -18,6 +18,7 @@ linter:
1818
- avoid_equals_and_hash_code_on_mutable_classes
1919
- avoid_escaping_inner_quotes
2020
- avoid_field_initializers_in_const_classes
21+
- avoid_final_parameters
2122
- avoid_function_literals_in_foreach_calls
2223
- avoid_implementing_value_types
2324
- avoid_init_to_null
@@ -31,8 +32,6 @@ linter:
3132
- avoid_relative_lib_imports
3233
- avoid_renaming_method_parameters
3334
- avoid_return_types_on_setters
34-
- avoid_returning_null
35-
- avoid_returning_null_for_future
3635
- avoid_returning_null_for_void
3736
- avoid_returning_this
3837
- avoid_setters_without_getters
@@ -53,39 +52,56 @@ linter:
5352
- cascade_invocations
5453
- cast_nullable_to_non_nullable
5554
- close_sinks
55+
- collection_methods_unrelated_type
56+
- combinators_ordering
5657
- comment_references
58+
- conditional_uri_does_not_exist
5759
- constant_identifier_names
5860
- control_flow_in_finally
5961
- curly_braces_in_flow_control_structures
62+
- dangling_library_doc_comments
6063
- depend_on_referenced_packages
6164
- deprecated_consistency
65+
- deprecated_member_use_from_same_package
6266
- diagnostic_describe_all_properties
6367
- directives_ordering
68+
- discarded_futures
6469
- do_not_use_environment
70+
- document_ignores
6571
- empty_catches
6672
- empty_constructor_bodies
6773
- empty_statements
74+
- eol_at_end_of_file
6875
- exhaustive_cases
6976
- file_names
7077
- flutter_style_todos
7178
- hash_and_equals
7279
- implementation_imports
73-
- invariant_booleans
74-
- iterable_contains_unrelated_type
80+
- implicit_call_tearoffs
81+
- implicit_reopen
82+
- invalid_case_patterns
83+
- invalid_runtime_check_with_js_interop_types
7584
- join_return_with_assignment
7685
- leading_newlines_in_multiline_strings
86+
- library_annotations
7787
- library_names
7888
- library_prefixes
7989
- library_private_types_in_public_api
8090
- lines_longer_than_80_chars
81-
- list_remove_unrelated_type
8291
- literal_only_boolean_expressions
92+
- matching_super_parameters
93+
- missing_code_block_language_in_doc_comment
8394
- missing_whitespace_between_adjacent_strings
8495
- no_adjacent_strings_in_list
8596
- no_default_cases
8697
- no_duplicate_case_values
98+
- no_leading_underscores_for_library_prefixes
99+
- no_leading_underscores_for_local_identifiers
100+
- no_literal_bool_comparisons
87101
- no_logic_in_create_state
88102
- no_runtimeType_toString
103+
- no_self_assignments
104+
- no_wildcard_variable_uses
89105
- non_constant_identifier_names
90106
- noop_primitive_operations
91107
- null_check_on_nullable_type_parameter
@@ -110,7 +126,6 @@ linter:
110126
- prefer_constructors_over_static_methods
111127
- prefer_contains
112128
- prefer_double_quotes
113-
- prefer_equal_for_default_values
114129
- prefer_expression_function_bodies
115130
- prefer_final_fields
116131
- prefer_final_in_for_each
@@ -142,7 +157,9 @@ linter:
142157
- public_member_api_docs
143158
- recursive_getters
144159
- require_trailing_commas
160+
- secure_pubspec_urls
145161
- sized_box_for_whitespace
162+
- sized_box_shrink_expand
146163
- slash_for_doc_comments
147164
- sort_child_properties_last
148165
- sort_constructors_first
@@ -153,15 +170,23 @@ linter:
153170
- tighten_type_of_initializing_formals
154171
- type_annotate_public_apis
155172
- type_init_formals
173+
- type_literal_in_constant_pattern
156174
- unawaited_futures
175+
- unintended_html_in_doc_comment
157176
- unnecessary_await_in_return
158177
- unnecessary_brace_in_string_interps
178+
- unnecessary_breaks
159179
- unnecessary_const
180+
- unnecessary_constructor_name
160181
- unnecessary_final
161182
- unnecessary_getters_setters
162183
- unnecessary_lambdas
184+
- unnecessary_late
185+
- unnecessary_library_directive
186+
- unnecessary_library_name
163187
- unnecessary_new
164188
- unnecessary_null_aware_assignments
189+
- unnecessary_null_aware_operator_on_extension_on_nullable
165190
- unnecessary_null_checks
166191
- unnecessary_null_in_if_null_operators
167192
- unnecessary_nullable_for_final_variable_declarations
@@ -172,9 +197,14 @@ linter:
172197
- unnecessary_string_escapes
173198
- unnecessary_string_interpolations
174199
- unnecessary_this
200+
- unnecessary_to_list_in_spreads
201+
- unreachable_from_main
175202
- unrelated_type_equality_checks
176203
- unsafe_html
177204
- use_build_context_synchronously
205+
- use_colored_box
206+
- use_decorated_box
207+
- use_enums
178208
- use_full_hex_values_for_flutter_colors
179209
- use_function_type_syntax_for_parameters
180210
- use_if_null_to_convert_nulls_to_bools
@@ -186,6 +216,8 @@ linter:
186216
- use_rethrow_when_possible
187217
- use_setters_to_change_properties
188218
- use_string_buffers
219+
- use_string_in_part_of_directives
220+
- use_super_parameters
189221
- use_test_throws_matchers
190222
- use_to_and_as_if_applicable
191223
- valid_regexps
File renamed without changes.

packages/custom_lint/CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
## Unreleased fix
1+
## Unreleased 0.7.0-dev.0
22

3-
- Fix compilation error when using latest analyzer
3+
- Upgraded to analyzer ^6.6.0.
4+
This is a quick fix to unblock the stable Flutter channel.
5+
A more robust fix will come later.
6+
- Fixed a bug where isSuperTypeOf throws if the element is null (thanks to @charlescyt)
47

58
## 0.6.4 - 2024-03-16
69

packages/custom_lint/example/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ linter:
88
rules:
99
public_member_api_docs: false
1010
avoid_print: false
11+
unreachable_from_main: false

packages/custom_lint/example/example_lint/lib/custom_lint_example_lint.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class PreferFinalProviders extends DartLintRule {
6868
}
6969

7070
// This emits our lint warning at the location of the variable.
71-
reporter.reportErrorForElement(code, element);
71+
reporter.atElement(element, code);
7272
});
7373
}
7474

packages/custom_lint/example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class Main {}
99
// expect_lint: riverpod_final_provider
1010
ProviderBase<int> provider = Provider((ref) => 0);
1111

12-
// expect_lint: riverpod_final_provider
1312
Provider<int> provider2 = Provider((ref) => 0);
1413

1514
Object? foo = 42;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@Deprecated('Import `package:custom_lint/custom_lint.dart` instead')
2-
library basic_runner;
2+
library;
33

44
export 'custom_lint.dart';

packages/custom_lint/lib/custom_lint.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ Future<void> _startWatchMode(
189189
fatalWarnings: fatalWarnings,
190190
format: format,
191191
);
192-
break;
193192
case 'q':
194193
// Let's quit the command line
195194
return;

packages/custom_lint/lib/src/analyzer_plugin_starter.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import 'plugin_delegate.dart';
77
import 'v2/custom_lint_analyzer_plugin.dart';
88

99
/// Connects custom_lint to the analyzer server using the analyzer_plugin protocol
10-
void start(Iterable<String> _, SendPort sendPort) {
10+
Future<void> start(Iterable<String> _, SendPort sendPort) async {
1111
final isInCI = ci.isCI;
1212

13-
CustomLintServer.start(
13+
await CustomLintServer.start(
1414
sendPort: sendPort,
1515
includeBuiltInLints: true,
1616
// The IDE client should write to files, as what's visible in the editor

packages/custom_lint/lib/src/analyzer_utils/analyzer_utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:analyzer/file_system/file_system.dart';
2-
// ignore: implementation_imports
2+
// ignore: implementation_imports, not exported
33
import 'package:analyzer/src/dart/analysis/byte_store.dart';
4-
// ignore: implementation_imports
4+
// ignore: implementation_imports, not exported
55
import 'package:analyzer/src/dart/analysis/file_byte_store.dart';
66

77
/// Adds [createByteStore].

0 commit comments

Comments
 (0)