Skip to content

Conversation

@jwr1
Copy link
Member

@jwr1 jwr1 commented Jan 30, 2026

  • I switched out flutter_lints for very_good_analysis, which is much more opinionated and makes use of more analysis rules.
  • I added a GitHub action to check Dart formatting and analysis on PRs, to ensure Dart code remains consistent. This should be especially helpful for big PRs like Navigation update #358 where a lot of files are affected and creates huge formatting diffs.

I will definitely wait till #358 and #359 are merged before addressing the analysis issues introduced by very_good_analysis. I'm sure the merge conflicts would be a nightmare :)

@jwr1
Copy link
Member Author

jwr1 commented Jan 30, 2026

Wow, it looks like this one's going to be a dozzy! Before running dart fix --apply, there are 2161 issues found. After running the command, there are still 803 issues found that would need to be manually fixed!

Analysis before fix (2161 issues)
441 cast_nullable_to_non_nullable
149 prefer_final_locals
138 lines_longer_than_80_chars
118 avoid_dynamic_calls
109 directives_ordering
105 sort_constructors_first
 96 prefer_const_constructors
 93 discarded_futures
 81 omit_local_variable_types
 76 unawaited_futures
 71 always_put_required_named_parameters_first
 51 prefer_final_in_for_each
 49 unnecessary_null_checks
 42 unused_local_variable
 40 argument_type_not_assignable
 36 avoid_catches_without_on_clauses
 32 avoid_positional_boolean_parameters
 28 avoid_redundant_argument_values
 25 prefer_const_declarations
 25 always_use_package_imports
 23 use_if_null_to_convert_nulls_to_bools
 23 inference_failure_on_function_invocation
 21 unnecessary_this
 21 specify_nonobvious_property_types
 18 unnecessary_parenthesis
 18 unnecessary_await_in_return
 16 avoid_void_async
 13 unnecessary_lambdas
 13 cascade_invocations
 12 prefer_int_literals
 11 unnecessary_breaks
 11 prefer_null_aware_method_calls
 11 for_in_of_invalid_type
 11 flutter_style_todos
 11 deprecated_member_use
  9 inference_failure_on_function_return_type
  9 always_declare_return_types
  8 parameter_assignments
  8 only_throw_errors
  7 invalid_assignment
  7 inference_failure_on_instance_creation
  6 sort_unnamed_constructors_first
  6 avoid_bool_literals_in_conditional_expressions
  5 not_map_spread
  5 non_bool_condition
  4 inference_failure_on_untyped_parameter
  4 eol_at_end_of_file
  3 use_named_constants
  3 use_build_context_synchronously
  3 return_of_invalid_type_from_closure
  3 prefer_foreach
  3 inference_failure_on_collection_literal
  2 use_late_for_private_fields_and_variables
  2 unnecessary_import
  2 strict_raw_type
  2 sort_pub_dependencies
  2 prefer_const_literals_to_create_immutables
  2 not_iterable_spread
  2 noop_primitive_operations
  2 combinators_ordering
  2 avoid_equals_and_hash_code_on_mutable_classes
  1 use_null_aware_elements
  1 unused_element_parameter
  1 unnecessary_raw_strings
  1 strict_top_level_inference
  1 recursive_getters
  1 prefer_if_elements_to_conditional_expressions
  1 prefer_final_fields
  1 join_return_with_assignment
  1 curly_braces_in_flow_control_structures
  1 collection_methods_unrelated_type
  1 avoid_unused_constructor_parameters
  1 avoid_slow_async_io
Analysis after fix (803 issues)
132 avoid_dynamic_calls
111 discarded_futures
 85 lines_longer_than_80_chars
 82 unawaited_futures
 44 argument_type_not_assignable
 42 unused_local_variable
 36 avoid_catches_without_on_clauses
 32 avoid_positional_boolean_parameters
 24 inference_failure_on_function_invocation
 23 unnecessary_null_checks
 15 specify_nonobvious_property_types
 13 cascade_invocations
 11 prefer_null_aware_method_calls
 11 for_in_of_invalid_type
 11 flutter_style_todos
 11 deprecated_member_use
  9 inference_failure_on_function_return_type
  9 final_and_var
  8 parameter_assignments
  8 only_throw_errors
  8 inference_failure_on_instance_creation
  7 invalid_assignment
  5 not_map_spread
  5 non_bool_condition
  4 use_named_constants
  4 not_a_type
  4 inference_failure_on_untyped_parameter
  4 extra_positional_arguments_could_be_named
  3 use_build_context_synchronously
  3 return_of_invalid_type_from_closure
  3 prefer_foreach
  3 inference_failure_on_collection_literal
  3 expected_token
  2 use_late_for_private_fields_and_variables
  2 strict_raw_type
  2 sort_pub_dependencies
  2 not_iterable_spread
  2 extra_positional_arguments
  2 duplicate_definition
  2 directives_ordering
  2 avoid_equals_and_hash_code_on_mutable_classes
  1 strict_top_level_inference
  1 recursive_getters
  1 non_type_as_type_argument
  1 non_constant_identifier_names
  1 non_bool_negation_expression
  1 missing_method_parameters
  1 missing_function_body
  1 join_return_with_assignment
  1 implicit_this_reference_in_initializer
  1 final_not_initialized_constructor
  1 collection_methods_unrelated_type
  1 avoid_types_as_parameter_names
  1 avoid_slow_async_io
  1 always_declare_return_types

@jwr1
Copy link
Member Author

jwr1 commented Feb 3, 2026

I ended up adding quite a few rules to the ignore list. A good bit of them were related to our use of dynamic in some places. We can save working on those for another day, as it would be a lot of effort to resolve every single one of them. Still, this is a huge improvement over what we are currently working with.

@jwr1 jwr1 requested a review from olorin99 February 3, 2026 18:27
@jwr1
Copy link
Member Author

jwr1 commented Feb 4, 2026

Looks like this issue is causing dart fix to error out: dart-lang/sdk#62068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants