Skip to content

Commit 44fab49

Browse files
feat: support Dart 3.9.0 (#162)
* feat: add analysis_options.10.0.0.yaml * chore: filter rules * chore: regenerate exclusion table * ci: use Dart SDK 3.9.0 * test: update version test * feat: add missing new lints
1 parent 394db3e commit 44fab49

15 files changed

+270
-46
lines changed

.github/workflows/bot_updater.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222

2323
- name: 🎯 Setup Dart
2424
uses: dart-lang/setup-dart@v1
25+
with:
26+
sdk: "3.9.0"
2527

2628
- name: 📦 Install Dependencies
2729
run: dart pub get
@@ -58,11 +60,11 @@ jobs:
5860
- name: 🔍 Check for deprecated rules changes
5961
id: deprecated
6062
run: (dart bin/analyze.dart --set-exit-if-changed && echo "deprecated_rules_changed=false" >> $GITHUB_ENV) || echo "deprecated_rules_changed=true" >> $GITHUB_ENV
61-
63+
6264
- name: ✍️ Remove deprecated rules
6365
if: ${{ env.deprecated_rules_changed == 'true' }}
6466
run: dart bin/remove_deprecated_rules.dart
65-
67+
6668
- name: 📝 Create Pull Request for deprecated rules
6769
if: ${{ env.deprecated_rules_changed == 'true' }}
6870
uses: peter-evans/[email protected]
@@ -77,4 +79,3 @@ jobs:
7779
author: VGV Bot <[email protected]>
7880
assignees: vgvbot
7981
committer: VGV Bot <[email protected]>
80-

.github/workflows/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v5
1313
- uses: dart-lang/setup-dart@v1
14+
with:
15+
sdk: "3.9.0"
1416

1517
- name: Install Dependencies
1618
run: dart pub get

.github/workflows/pub_publish.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
uses: actions/checkout@v5
1616
- name: 🎯 Setup Dart
1717
uses: dart-lang/setup-dart@v1
18+
with:
19+
sdk: "3.9.0"
1820
- name: 📦 Install Dependencies
1921
run: dart pub get
2022
- name: 🌵 Dry Run

.github/workflows/tool_linter_rules.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ concurrency:
77
on:
88
pull_request:
99
paths:
10-
- 'tool/linter_rules/**'
11-
- '.github/workflows/tool_linter_rules.yaml'
12-
- 'pubspec.yaml'
10+
- "tool/linter_rules/**"
11+
- ".github/workflows/tool_linter_rules.yaml"
12+
- "pubspec.yaml"
1313

1414
jobs:
1515
build:
1616
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
1717
with:
18-
dart_sdk: 3.8.0
18+
dart_sdk: 3.9.0
1919
working_directory: tool/linter_rules

.github/workflows/verify_version.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
- uses: actions/checkout@v5
1414

1515
- uses: dart-lang/setup-dart@v1
16+
with:
17+
sdk: "3.9.0"
1618

1719
- name: Verify version consistency
1820
run: dart run tool/verify_version/main.dart

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ If you intend to provide changes related to a **new Dart version** you can follo
3838
- Choose `<NEW_VERSION>` according to [Semantic Versioning](https://semver.org/) guidelines based on your proposed changes.
3939
1. Add or remove the lint rules you want to change in the version file you generated in step 2.
4040
- To find new rules more easily you can run the same command as in step 4 which will add new rules directly to the exclusion table.
41-
1. Open a terminal in `tool/linter_rules` and run `dart lib/exclusion_reason_table.dart` to generate an up-to-date exclusion table.
41+
1. Open a terminal in `tool/linter_rules` and run `dart lib/exclusion_reason_table.dart` to generate an up-to-date exclusion table.
4242
1. Document the rules that were removed with a reason as to why, if there is any.
4343
- Link to an issue as to why a lint rule should not be used if there is any.
4444
1. Create a pull request following the guidelines in the [Creating a Pull Request](#creating-a-pull-request) section below.

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,35 +102,23 @@ Below is a list of rules that are not enabled by default together with the reaso
102102
| [`avoid_null_checks_in_equality_operators`](https://dart.dev/tools/linter-rules/avoid_null_checks_in_equality_operators) | Has been deprecated and [will be removed](https://github.com/dart-lang/sdk/issues/59514) |
103103
| [`avoid_types_on_closure_parameters`](https://dart.dev/tools/linter-rules/avoid_types_on_closure_parameters) | Not specified |
104104
| [`close_sinks`](https://dart.dev/tools/linter-rules/close_sinks) | [Has unresolved false positives](https://github.com/dart-lang/linter/issues/1381) |
105-
| [`deprecated_member_use_from_same_package`](https://dart.dev/tools/linter-rules/deprecated_member_use_from_same_package) | Not specified |
106-
| [`diagnostic_describe_all_properties`](https://dart.dev/tools/linter-rules/diagnostic_describe_all_properties) | Not specified |
107-
| [`discarded_futures`](https://dart.dev/tools/linter-rules/discarded_futures) | [Has unresolved false positives](https://github.com/VeryGoodOpenSource/very_good_analysis/issues/74#issuecomment-1668425410) |
108105
| [`do_not_use_environment`](https://dart.dev/tools/linter-rules/do_not_use_environment) | Not specified |
109106
| [`library_names`](https://dart.dev/tools/linter-rules/library_names) | [Superseded by `unnecessary_library_name`](https://github.com/dart-lang/lints/issues/172) |
110-
| [`matching_super_parameters`](https://dart.dev/tools/linter-rules/matching_super_parameters) | Not specified |
111-
| [`no_literal_bool_comparisons`](https://dart.dev/tools/linter-rules/no_literal_bool_comparisons) | Not specified |
112107
| [`omit_obvious_local_variable_types`](https://dart.dev/tools/linter-rules/omit_obvious_local_variable_types) | Not specified |
113108
| [`omit_obvious_property_types`](https://dart.dev/tools/linter-rules/omit_obvious_property_types) | Incompatible with [type_annotate_public_apis](https://github.com/dart-lang/sdk/issues/60642) |
114109
| [`package_prefixed_library_names`](https://dart.dev/tools/linter-rules/package_prefixed_library_names) | [Broken; superseded by `unnecessary_library_name`](https://github.com/dart-lang/lints/issues/172) |
115110
| [`prefer_double_quotes`](https://dart.dev/tools/linter-rules/prefer_double_quotes) | Incompatible with [prefer_single_quotes](https://dart.dev/tools/linter-rules/prefer_single_quotes) |
116111
| [`prefer_expression_function_bodies`](https://dart.dev/tools/linter-rules/prefer_expression_function_bodies) | Not specified |
117112
| [`prefer_final_parameters`](https://dart.dev/tools/linter-rules/prefer_final_parameters) | Incompatible with [avoid_final_parameters](https://dart.dev/tools/linter-rules/avoid_final_parameters) |
118-
| [`prefer_foreach`](https://dart.dev/tools/linter-rules/prefer_foreach) | Not specified |
119113
| [`prefer_mixin`](https://dart.dev/tools/linter-rules/prefer_mixin) | Not specified |
120114
| [`prefer_relative_imports`](https://dart.dev/tools/linter-rules/prefer_relative_imports) | Incompatible with [always_use_package_imports](https://dart.dev/tools/linter-rules/always_use_package_imports) |
121115
| [`prefer_void_to_null`](https://dart.dev/tools/linter-rules/prefer_void_to_null) | [Has unresolved false positives](https://github.com/dart-lang/linter/issues/4758) |
122116
| [`require_trailing_commas`](https://dart.dev/tools/linter-rules/require_trailing_commas) | Not specified |
123117
| [`specify_nonobvious_local_variable_types`](https://dart.dev/tools/linter-rules/specify_nonobvious_local_variable_types) | Not specified |
124-
| [`switch_on_type`](https://dart.dev/tools/linter-rules/switch_on_type) | Not specified |
125118
| [`unnecessary_async`](https://dart.dev/tools/linter-rules/unnecessary_async) | Not specified |
126119
| [`unnecessary_final`](https://dart.dev/tools/linter-rules/unnecessary_final) | Incompatible with [prefer_final_locals](https://dart.dev/tools/linter-rules/prefer_final_locals) |
127-
| [`unnecessary_ignore`](https://dart.dev/tools/linter-rules/unnecessary_ignore) | Not specified |
128-
| [`unnecessary_null_aware_operator_on_extension_on_nullable`](https://dart.dev/tools/linter-rules/unnecessary_null_aware_operator_on_extension_on_nullable) | Not specified |
129-
| [`unnecessary_unawaited`](https://dart.dev/tools/linter-rules/unnecessary_unawaited) | Not specified |
130-
| [`unreachable_from_main`](https://dart.dev/tools/linter-rules/unreachable_from_main) | Not specified |
131120
| [`unsafe_variance`](https://dart.dev/tools/linter-rules/unsafe_variance) | Not specified |
132121
| [`use_decorated_box`](https://dart.dev/tools/linter-rules/use_decorated_box) | [Has unresolved malfunctions](https://github.com/dart-lang/linter/issues/3286) |
133-
| [`use_null_aware_elements`](https://dart.dev/tools/linter-rules/use_null_aware_elements) | Not specified |
134122
| [`use_truncating_division`](https://dart.dev/tools/linter-rules/use_truncating_division) | Not specified |
135123
<!-- end:excluded_rules_table -->
136124

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.0.1
33
publish_to: none
44

55
environment:
6-
sdk: ^3.8.0
6+
sdk: ^3.9.0
77

88
dependencies:
99
very_good_analysis:

lib/analysis_options.10.0.0.yaml

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
analyzer:
2+
language:
3+
strict-casts: true
4+
strict-inference: true
5+
strict-raw-types: true
6+
7+
errors:
8+
close_sinks: ignore
9+
missing_required_param: error
10+
missing_return: error
11+
record_literal_one_positional_no_trailing_comma: error
12+
collection_methods_unrelated_type: warning
13+
unrelated_type_equality_checks: warning
14+
15+
exclude:
16+
- test/.test_coverage.dart
17+
- lib/generated_plugin_registrant.dart
18+
19+
formatter:
20+
trailing_commas: preserve
21+
22+
linter:
23+
rules:
24+
- always_declare_return_types
25+
- always_put_required_named_parameters_first
26+
- always_use_package_imports
27+
- annotate_overrides
28+
- avoid_bool_literals_in_conditional_expressions
29+
- avoid_catches_without_on_clauses
30+
- avoid_catching_errors
31+
- avoid_double_and_int_checks
32+
- avoid_dynamic_calls
33+
- avoid_empty_else
34+
- avoid_equals_and_hash_code_on_mutable_classes
35+
- avoid_escaping_inner_quotes
36+
- avoid_field_initializers_in_const_classes
37+
- avoid_final_parameters
38+
- avoid_function_literals_in_foreach_calls
39+
- avoid_init_to_null
40+
- avoid_js_rounded_ints
41+
- avoid_multiple_declarations_per_line
42+
- avoid_positional_boolean_parameters
43+
- avoid_print
44+
- avoid_private_typedef_functions
45+
- avoid_redundant_argument_values
46+
- avoid_relative_lib_imports
47+
- avoid_renaming_method_parameters
48+
- avoid_return_types_on_setters
49+
- avoid_returning_null_for_void
50+
- avoid_returning_this
51+
- avoid_setters_without_getters
52+
- avoid_shadowing_type_parameters
53+
- avoid_single_cascade_in_expression_statements
54+
- avoid_slow_async_io
55+
- avoid_type_to_string
56+
- avoid_types_as_parameter_names
57+
- avoid_unnecessary_containers
58+
- avoid_unused_constructor_parameters
59+
- avoid_void_async
60+
- avoid_web_libraries_in_flutter
61+
- await_only_futures
62+
- camel_case_extensions
63+
- camel_case_types
64+
- cancel_subscriptions
65+
- cascade_invocations
66+
- cast_nullable_to_non_nullable
67+
- collection_methods_unrelated_type
68+
- combinators_ordering
69+
- comment_references
70+
- conditional_uri_does_not_exist
71+
- constant_identifier_names
72+
- control_flow_in_finally
73+
- curly_braces_in_flow_control_structures
74+
- dangling_library_doc_comments
75+
- depend_on_referenced_packages
76+
- deprecated_consistency
77+
- deprecated_member_use_from_same_package
78+
- diagnostic_describe_all_properties
79+
- directives_ordering
80+
- discarded_futures
81+
- document_ignores
82+
- empty_catches
83+
- empty_constructor_bodies
84+
- empty_statements
85+
- eol_at_end_of_file
86+
- exhaustive_cases
87+
- file_names
88+
- flutter_style_todos
89+
- hash_and_equals
90+
- implicit_call_tearoffs
91+
- implementation_imports
92+
- implicit_reopen
93+
- invalid_case_patterns
94+
- invalid_runtime_check_with_js_interop_types
95+
- join_return_with_assignment
96+
- leading_newlines_in_multiline_strings
97+
- library_annotations
98+
- library_prefixes
99+
- library_private_types_in_public_api
100+
- lines_longer_than_80_chars
101+
- literal_only_boolean_expressions
102+
- matching_super_parameters
103+
- missing_code_block_language_in_doc_comment
104+
- missing_whitespace_between_adjacent_strings
105+
- no_adjacent_strings_in_list
106+
- no_default_cases
107+
- no_duplicate_case_values
108+
- no_leading_underscores_for_library_prefixes
109+
- no_leading_underscores_for_local_identifiers
110+
- no_literal_bool_comparisons
111+
- no_logic_in_create_state
112+
- no_runtimeType_toString
113+
- no_self_assignments
114+
- no_wildcard_variable_uses
115+
- non_constant_identifier_names
116+
- noop_primitive_operations
117+
- null_check_on_nullable_type_parameter
118+
- null_closures
119+
- omit_local_variable_types
120+
- one_member_abstracts
121+
- only_throw_errors
122+
- overridden_fields
123+
- package_names
124+
- parameter_assignments
125+
- prefer_adjacent_string_concatenation
126+
- prefer_asserts_in_initializer_lists
127+
- prefer_asserts_with_message
128+
- prefer_collection_literals
129+
- prefer_conditional_assignment
130+
- prefer_const_constructors
131+
- prefer_const_constructors_in_immutables
132+
- prefer_const_declarations
133+
- prefer_const_literals_to_create_immutables
134+
- prefer_constructors_over_static_methods
135+
- prefer_contains
136+
- prefer_final_fields
137+
- prefer_final_in_for_each
138+
- prefer_final_locals
139+
- prefer_foreach
140+
- prefer_for_elements_to_map_fromIterable
141+
- prefer_function_declarations_over_variables
142+
- prefer_generic_function_type_aliases
143+
- prefer_if_elements_to_conditional_expressions
144+
- prefer_if_null_operators
145+
- prefer_initializing_formals
146+
- prefer_inlined_adds
147+
- prefer_int_literals
148+
- prefer_interpolation_to_compose_strings
149+
- prefer_is_empty
150+
- prefer_is_not_empty
151+
- prefer_is_not_operator
152+
- prefer_iterable_whereType
153+
- prefer_null_aware_method_calls
154+
- prefer_null_aware_operators
155+
- prefer_single_quotes
156+
- prefer_spread_collections
157+
- prefer_typing_uninitialized_variables
158+
- provide_deprecation_message
159+
- public_member_api_docs
160+
- recursive_getters
161+
- require_trailing_commas
162+
- secure_pubspec_urls
163+
- sized_box_for_whitespace
164+
- sized_box_shrink_expand
165+
- slash_for_doc_comments
166+
- sort_child_properties_last
167+
- sort_constructors_first
168+
- sort_pub_dependencies
169+
- sort_unnamed_constructors_first
170+
- specify_nonobvious_property_types
171+
- strict_top_level_inference
172+
- switch_on_type
173+
- test_types_in_equals
174+
- throw_in_finally
175+
- tighten_type_of_initializing_formals
176+
- type_annotate_public_apis
177+
- type_init_formals
178+
- type_literal_in_constant_pattern
179+
- unawaited_futures
180+
- unintended_html_in_doc_comment
181+
- unnecessary_await_in_return
182+
- unnecessary_breaks
183+
- unnecessary_brace_in_string_interps
184+
- unnecessary_const
185+
- unnecessary_constructor_name
186+
- unnecessary_getters_setters
187+
- unnecessary_ignore
188+
- unnecessary_lambdas
189+
- unnecessary_late
190+
- unnecessary_library_directive
191+
- unnecessary_library_name
192+
- unnecessary_new
193+
- unnecessary_null_aware_assignments
194+
- unnecessary_null_aware_operator_on_extension_on_nullable
195+
- unnecessary_null_checks
196+
- unnecessary_null_in_if_null_operators
197+
- unnecessary_nullable_for_final_variable_declarations
198+
- unnecessary_overrides
199+
- unnecessary_parenthesis
200+
- unnecessary_raw_strings
201+
- unnecessary_statements
202+
- unnecessary_string_escapes
203+
- unnecessary_string_interpolations
204+
- unnecessary_this
205+
- unnecessary_to_list_in_spreads
206+
- unnecessary_unawaited
207+
- unnecessary_underscores
208+
- unreachable_from_main
209+
- unrelated_type_equality_checks
210+
- use_build_context_synchronously
211+
- use_colored_box
212+
- use_enums
213+
- use_full_hex_values_for_flutter_colors
214+
- use_function_type_syntax_for_parameters
215+
- use_if_null_to_convert_nulls_to_bools
216+
- use_is_even_rather_than_modulo
217+
- use_key_in_widget_constructors
218+
- use_late_for_private_fields_and_variables
219+
- use_named_constants
220+
- use_null_aware_elements
221+
- use_raw_strings
222+
- use_rethrow_when_possible
223+
- use_setters_to_change_properties
224+
- use_string_buffers
225+
- use_string_in_part_of_directives
226+
- use_super_parameters
227+
- use_test_throws_matchers
228+
- use_to_and_as_if_applicable
229+
- use_truncating_division
230+
- valid_regexps
231+
- void_checks

lib/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:very_good_analysis/analysis_options.9.0.0.yaml
1+
include: package:very_good_analysis/analysis_options.10.0.0.yaml

0 commit comments

Comments
 (0)