diff --git a/moor_flutter/CHANGELOG.md b/moor_flutter/CHANGELOG.md index e06cb1f5..0d657047 100644 --- a/moor_flutter/CHANGELOG.md +++ b/moor_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.0-nullsafety + +- Support moor version 4 +- Migrate to null-safety + ## 3.1.0 Don't write the schema version to the database if the migration throws an exception. diff --git a/moor_flutter/analysis_options.yaml b/moor_flutter/analysis_options.yaml deleted file mode 120000 index c9e0d9fb..00000000 --- a/moor_flutter/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -../analysis_options.yaml \ No newline at end of file diff --git a/moor_flutter/analysis_options.yaml b/moor_flutter/analysis_options.yaml new file mode 100644 index 00000000..98d91963 --- /dev/null +++ b/moor_flutter/analysis_options.yaml @@ -0,0 +1,175 @@ +analyzer: + strong-mode: + implicit-casts: false + errors: + unused_element: error + unused_import: error + unused_local_variable: error + dead_code: error + public_member_api_docs: ignore # turned on by user-facing subpackages + deprecated_member_use_from_same_package: ignore + exclude: + - "**/*.g.dart" + # Will be analyzed anyway, nobody knows why ¯\_(ツ)_/¯. We're only analyzing lib/ and test/ as a workaround + - ".dart_tool/build/entrypoint/build.dart" + - "tool/**" + - "**/*.mocks.dart" + +# this should always include all rules. Those we don't use are commented out +linter: + rules: + # ERROR RULES + - avoid_empty_else + # - avoid_print (all our prints can be turned off) + - avoid_relative_lib_imports + - avoid_returning_null_for_future + # - avoid_slow_async_io + - avoid_types_as_parameter_names + - cancel_subscriptions + - close_sinks + - comment_references + - control_flow_in_finally + # - diagnostic_describe_all_properties (Flutter-specific, not relevant for us) + - empty_statements + - hash_and_equals + # - invariant_booleans (turned off because the lint rule is buggy) + - iterable_contains_unrelated_type + - list_remove_unrelated_type + - literal_only_boolean_expressions + - no_adjacent_strings_in_list + - no_duplicate_case_values + # - prefer_relative_imports (clashes with avoid_relative_lib_imports) + # - prefer_void_to_null (we do use Null as a type for alwaysThrows functions) + - test_types_in_equals + - throw_in_finally + - unnecessary_statements + - unrelated_type_equality_checks + - unsafe_html + - valid_regexps + # STYLE RULES + - always_declare_return_types + # - always_put_control_body_on_new_line (we don't do this if it fits on the same line) + # - always_put_required_named_parameters_first (we just don't do this) + # - always_require_non_null_named_parameters (we don't use assert foo != null for parameters) + # - always_specify_types (we prefer to omit the type parameter when possible) + - annotate_overrides + # - avoid_annotating_with_dynamic (we prefer to make dynamic explicit) + # - avoid_as (we prefer to make explicit casts explicit!) + - avoid_bool_literals_in_conditional_expressions + # - avoid_catches_without_on_clauses (we have a lot of generic catches) + - avoid_catching_errors + - avoid_classes_with_only_static_members + - avoid_double_and_int_checks + # - avoid_equals_and_hash_code_on_mutable_classes (lint is to generic for transient fields) + - avoid_field_initializers_in_const_classes + - avoid_function_literals_in_foreach_calls + # - avoid_implementing_value_types (maybe we can consider turning this on?) + - avoid_init_to_null + - avoid_js_rounded_ints + - avoid_null_checks_in_equality_operators + # - avoid_positional_boolean_parameters (there pretty useful when there's only one boolean param) + # - avoid_private_typedef_functions (they're still useful) + - avoid_renaming_method_parameters + - avoid_return_types_on_setters + - avoid_returning_null + - avoid_returning_null_for_void + - avoid_returning_this + - avoid_setters_without_getters + - avoid_shadowing_type_parameters + - avoid_single_cascade_in_expression_statements + # - avoid_types_on_closure_parameters (the interference isn't THAT good) + # - avoid_unnecessary_containers (Flutter-specific, not relevant here) + - avoid_unused_constructor_parameters + - avoid_void_async + - await_only_futures + - camel_case_extensions + - camel_case_types + # - cascade_invocations (sometimes the explicit notation is more readable) + - constant_identifier_names + - curly_braces_in_flow_control_structures + - directives_ordering + - empty_catches + - empty_constructor_bodies + - file_names + # - flutter_style_todos (Flutter-development specific, not relevant here) + - implementation_imports + - join_return_with_assignment + - library_names + - library_prefixes + - lines_longer_than_80_chars + - non_constant_identifier_names + - null_closures + - omit_local_variable_types + # - one_member_abstracts (there are cases where a one-member abstract class makes sense, see moor's Insertable) + - only_throw_errors + - overridden_fields + - package_api_docs + # - package_prefixed_library_names (this isn't java) + # - parameter_assignments (we regularly use this to set default values) + - prefer_adjacent_string_concatenation + - prefer_asserts_in_initializer_lists + # - prefer_asserts_with_message (it's annoying to write messages for internal invariants) + - prefer_collection_literals + - prefer_conditional_assignment + - prefer_const_constructors + - prefer_const_constructors_in_immutables + - prefer_const_declarations + - prefer_const_literals_to_create_immutables + - prefer_constructors_over_static_methods + - prefer_contains + # - prefer_double_quotes (we prefer single quotes) + - prefer_equal_for_default_values + # - prefer_expression_function_bodies (for multiline expressions, this is ugly to format) + - prefer_final_fields + - prefer_final_in_for_each + - prefer_final_locals + - prefer_for_elements_to_map_fromIterable + - prefer_foreach + - prefer_function_declarations_over_variables + - prefer_generic_function_type_aliases + - prefer_if_elements_to_conditional_expressions + - prefer_if_null_operators + - prefer_initializing_formals + - prefer_inlined_adds + - prefer_int_literals + - prefer_interpolation_to_compose_strings + - prefer_is_empty + - prefer_is_not_empty + - prefer_is_not_operator + - prefer_iterable_whereType + # - prefer_mixin (todo we could consider enabling this) + - prefer_null_aware_operators + - prefer_single_quotes + - prefer_spread_collections + - prefer_typing_uninitialized_variables + - provide_deprecation_message + - public_member_api_docs + - recursive_getters + - slash_for_doc_comments + # - sort_child_properties_last (Flutter specific) + # - sort_constructors_first (we don't do this) + # - sort_unnamed_constructors_first + - type_annotate_public_apis + - type_init_formals + - unawaited_futures + - unnecessary_brace_in_string_interps + - unnecessary_const + # - unnecessary_final (we prefer final here) + - unnecessary_getters_setters + - unnecessary_lambdas + - unnecessary_new + - unnecessary_null_aware_assignments + - unnecessary_null_in_if_null_operators + - unnecessary_overrides + - unnecessary_parenthesis + - unnecessary_this + # - use_full_hex_values_for_flutter_colors (Flutter specific) + - use_function_type_syntax_for_parameters + - use_rethrow_when_possible + - use_setters_to_change_properties + - use_string_buffers + # - use_to_and_as_if_applicable (false positive on operators) + - void_checks + # PUB RULES + - package_names +# - sort_pub_dependencies (we prefer to group them by what they do) \ No newline at end of file diff --git a/moor_flutter/pubspec.lock b/moor_flutter/pubspec.lock index 90a0bb0e..9a86a3ea 100644 --- a/moor_flutter/pubspec.lock +++ b/moor_flutter/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.3" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.5" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.3" + version: "1.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.5" + version: "1.15.0" convert: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.3" + version: "1.2.0" ffi: dependency: transitive description: @@ -80,28 +80,28 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.3" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.6" + version: "1.3.0" moor: dependency: "direct main" description: - path: "../moor" - relative: true - source: path - version: "3.5.0-dev" + name: moor + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0-nullsafety.1" path: dependency: "direct main" description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.3" + version: "1.8.0" pedantic: dependency: transitive description: @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.4" + version: "1.8.0" sqflite: dependency: "direct main" description: @@ -148,21 +148,21 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.6" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" synchronized: dependency: transitive description: @@ -176,28 +176,28 @@ packages: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.3" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.6" + version: "0.2.19" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.5" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.5" + version: "2.1.0" sdks: dart: ">=2.12.0-29 <3.0.0" - flutter: ">=1.24.0-10 <2.0.0" + flutter: ">=1.24.0-10" diff --git a/moor_flutter/pubspec.yaml b/moor_flutter/pubspec.yaml index 2dd07f5c..bb139a8e 100644 --- a/moor_flutter/pubspec.yaml +++ b/moor_flutter/pubspec.yaml @@ -19,9 +19,9 @@ dev_dependencies: flutter_test: sdk: flutter -dependency_overrides: - moor: - path: ../moor +#dependency_overrides: +# moor: +# path: ../moor # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec