Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package version to 2.2.0 #135

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/yumemi_lints/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ Examples of version updates are as follows:
> [!NOTE]
> Changes to `tools/update_lint_rules` don't affect versioning.

## 2.2.0

### Features

- Added support for Dart 3.5.x.
- Added support for Flutter 3.24.x.

### Improvements

- Output to use "categories" instead of "group".

## 2.1.0

- Added support for Dart 3.4.x.
Expand Down
373 changes: 184 additions & 189 deletions packages/yumemi_lints/lib/dart/2.17/all.yaml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo-badge
Confirmed that there is no difference in the contents of all all.yaml's in Dart.

Test Code

import 'dart:io';

import 'package:test/test.dart';

void main() {
  final dartSdkVersions = [
    '2.17',
    '2.18',
    '2.19',
    '3.0',
    '3.1',
    '3.2',
    '3.3',
    '3.4',
  ];

  final regex = RegExp(r'^- (?<name>[a-zA-Z_]+)\s+(.*)$');

  for (final dartSdkVersion in dartSdkVersions) {
    group(
      'Whether there is a difference: $dartSdkVersion',
      () {
        final oldContent = File(
          'test/old/dart/$dartSdkVersion/all.yaml',
        ).readAsStringSync();
        final newContent = File(
          'test/new/dart/$dartSdkVersion/all.yaml',
        ).readAsStringSync();

        final newContents = newContent.split('\n');

        for (final newContent in newContents) {
          final content = newContent.trim();
          final a = regex.firstMatch(content);
          final lintName = a?.namedGroup('name');
          if (lintName == null) {
            continue;
          }

          test(
            'lint rule: $lintName',
            () {
              expect(
                oldContent.contains('- $lintName'),
                isTrue,
              );
            },
          );
        }
      },
    );
  }
}

Large diffs are not rendered by default.

379 changes: 187 additions & 192 deletions packages/yumemi_lints/lib/dart/2.18/all.yaml

Large diffs are not rendered by default.

395 changes: 195 additions & 200 deletions packages/yumemi_lints/lib/dart/2.19/all.yaml

Large diffs are not rendered by default.

409 changes: 202 additions & 207 deletions packages/yumemi_lints/lib/dart/3.0/all.yaml

Large diffs are not rendered by default.

413 changes: 204 additions & 209 deletions packages/yumemi_lints/lib/dart/3.1/all.yaml

Large diffs are not rendered by default.

415 changes: 205 additions & 210 deletions packages/yumemi_lints/lib/dart/3.2/all.yaml

Large diffs are not rendered by default.

415 changes: 205 additions & 210 deletions packages/yumemi_lints/lib/dart/3.3/all.yaml

Large diffs are not rendered by default.

419 changes: 207 additions & 212 deletions packages/yumemi_lints/lib/dart/3.4/all.yaml

Large diffs are not rendered by default.

214 changes: 214 additions & 0 deletions packages/yumemi_lints/lib/dart/3.5/all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
# GENERATED CODE - DO NOT MODIFY BY HAND

linter:
rules:
- always_declare_return_types # categories: style
- always_put_control_body_on_new_line # categories: style
- always_put_required_named_parameters_first # categories: style
- always_specify_types # incompatibles: avoid_types_on_closure_parameters,omit_local_variable_types,omit_obvious_local_variable_types # categories: style
- always_use_package_imports # incompatibles: prefer_relative_imports # categories: error-prone
- annotate_overrides # categories: style
- annotate_redeclares # categories: style
- avoid_annotating_with_dynamic # categories: brevity,style
- avoid_bool_literals_in_conditional_expressions # categories: brevity
- avoid_catches_without_on_clauses # categories: effective dart,style
- avoid_catching_errors # categories: style
- avoid_classes_with_only_static_members # categories: effective dart,language feature usage,style
- avoid_double_and_int_checks # categories: error-prone,web
- avoid_dynamic_calls # categories: binary size,error-prone
- avoid_empty_else # categories: brevity,error-prone
- avoid_equals_and_hash_code_on_mutable_classes # categories: effective dart,style
- avoid_escaping_inner_quotes # categories: style
- avoid_field_initializers_in_const_classes # categories: style
- avoid_final_parameters # incompatibles: prefer_final_parameters # categories: style
- avoid_function_literals_in_foreach_calls # categories: style
- avoid_implementing_value_types # categories: style
- avoid_init_to_null # categories: brevity,effective dart,style
- avoid_js_rounded_ints # categories: error-prone,web
- avoid_multiple_declarations_per_line # categories: style
- avoid_null_checks_in_equality_operators # categories: style
- avoid_positional_boolean_parameters # categories: effective dart,style
- avoid_print # categories: unintentional
- avoid_private_typedef_functions # categories: style
- avoid_redundant_argument_values # categories: brevity,style
- avoid_relative_lib_imports # categories: error-prone
- avoid_renaming_method_parameters # categories: documentation comment maintenance
- avoid_return_types_on_setters # categories: brevity,style
- avoid_returning_null_for_void # categories: style
- avoid_returning_this # categories: effective dart,style
- avoid_setters_without_getters # categories: style
- avoid_shadowing_type_parameters # categories: error-prone
- avoid_single_cascade_in_expression_statements # categories: brevity,style
- avoid_slow_async_io # categories: non-performant
- avoid_type_to_string # categories: unintentional
- avoid_types_as_parameter_names # categories: unintentional
- avoid_types_on_closure_parameters # incompatibles: always_specify_types # categories: style
- avoid_unused_constructor_parameters # categories: unintentional
- avoid_void_async # categories: style
- await_only_futures # categories: style
- camel_case_extensions # categories: effective dart,style
- camel_case_types # categories: effective dart,style
- cancel_subscriptions # categories: error-prone,memory leaks
- cascade_invocations # categories: brevity,language feature usage,style
- cast_nullable_to_non_nullable # categories: error-prone
- close_sinks # categories: error-prone,memory leaks
- collection_methods_unrelated_type # categories: unintentional
- combinators_ordering # categories: style
- comment_references # categories: documentation comment maintenance
- conditional_uri_does_not_exist # categories: error-prone
- constant_identifier_names # categories: style
- control_flow_in_finally # categories: error-prone
- curly_braces_in_flow_control_structures # categories: error-prone
- dangling_library_doc_comments # categories: documentation comment maintenance
- depend_on_referenced_packages # categories: pub
- deprecated_consistency # categories: style
- deprecated_member_use_from_same_package # categories: language feature usage
- directives_ordering # categories: style
- discarded_futures # categories: error-prone
- do_not_use_environment # categories: error-prone
- document_ignores # categories: style
- empty_catches # categories: style
- empty_constructor_bodies # categories: brevity,effective dart,style
- empty_statements # categories: error-prone
- eol_at_end_of_file # categories: style
- exhaustive_cases # categories: error-prone
- file_names # categories: style
- flutter_style_todos # categories: style
- hash_and_equals # categories: error-prone
- implementation_imports # categories: style
- implicit_call_tearoffs # categories: style
- implicit_reopen # categories: error-prone
- invalid_case_patterns # categories: language feature usage
- invalid_runtime_check_with_js_interop_types # categories: error-prone,web
- join_return_with_assignment # categories: brevity,style
- leading_newlines_in_multiline_strings # categories: style
- library_annotations # categories: style
- library_names # categories: style
- library_prefixes # categories: style
- library_private_types_in_public_api # categories: public interface
- lines_longer_than_80_chars # categories: style
- literal_only_boolean_expressions # categories: unused code
- matching_super_parameters # categories: style
- missing_code_block_language_in_doc_comment # categories: error-prone
- missing_whitespace_between_adjacent_strings # categories: error-prone
- no_adjacent_strings_in_list # categories: style
- no_default_cases # categories: style
- no_duplicate_case_values # categories: error-prone
- no_leading_underscores_for_library_prefixes # categories: style
- no_leading_underscores_for_local_identifiers # categories: style
- no_literal_bool_comparisons # categories: effective dart,style
- no_runtimeType_toString # categories: non-performant
- no_self_assignments # categories: unintentional
- no_wildcard_variable_uses # categories: language feature usage,unintentional
- non_constant_identifier_names # categories: style
- noop_primitive_operations # categories: style
- null_check_on_nullable_type_parameter # categories: style
- null_closures # categories: error-prone
- omit_local_variable_types # incompatibles: always_specify_types # categories: style
- one_member_abstracts # categories: effective dart,language feature usage,style
- only_throw_errors # categories: style
- overridden_fields # categories: style
- package_api_docs # categories: effective dart,public interface
- package_names # categories: style
- package_prefixed_library_names # categories: style
- parameter_assignments # categories: style
- prefer_adjacent_string_concatenation # categories: style
- prefer_asserts_in_initializer_lists # categories: style
- prefer_asserts_with_message # categories: style
- prefer_collection_literals # categories: brevity,style
- prefer_conditional_assignment # categories: brevity,style
- prefer_const_constructors # categories: style
- prefer_const_constructors_in_immutables # categories: style
- prefer_const_declarations # categories: style
- prefer_const_literals_to_create_immutables # categories: style
- prefer_constructors_over_static_methods # categories: style
- prefer_contains # categories: style
- prefer_double_quotes # incompatibles: prefer_single_quotes # categories: style
- prefer_expression_function_bodies # categories: brevity,style
- prefer_final_fields # categories: effective dart,style
- prefer_final_in_for_each # categories: style
- prefer_final_locals # incompatibles: unnecessary_final # categories: style
- prefer_final_parameters # incompatibles: unnecessary_final,avoid_final_parameters # categories: style
- prefer_for_elements_to_map_fromIterable # categories: brevity,style
- prefer_foreach # categories: style
- prefer_function_declarations_over_variables # categories: effective dart,style
- prefer_generic_function_type_aliases # categories: style
- prefer_if_elements_to_conditional_expressions # categories: brevity,style
- prefer_if_null_operators # categories: brevity,style
- prefer_initializing_formals # categories: brevity,style
- prefer_inlined_adds # categories: brevity,style
- prefer_int_literals # categories: style
- prefer_interpolation_to_compose_strings # categories: style
- prefer_is_empty # categories: style
- prefer_is_not_empty # categories: style
- prefer_is_not_operator # categories: brevity,style
- prefer_iterable_whereType # categories: style
- prefer_mixin # categories: language feature usage,style
- prefer_null_aware_method_calls # categories: brevity,style
- prefer_null_aware_operators # categories: brevity,style
- prefer_relative_imports # incompatibles: always_use_package_imports # categories: error-prone
- prefer_single_quotes # incompatibles: prefer_double_quotes # categories: style
- prefer_spread_collections # categories: brevity,style
- prefer_typing_uninitialized_variables # categories: error-prone,unintentional
- prefer_void_to_null # categories: error-prone
- provide_deprecation_message # categories: public interface
- public_member_api_docs # categories: public interface,style
- recursive_getters # categories: error-prone,unintentional
- require_trailing_commas # categories: style
- secure_pubspec_urls # categories: pub
- slash_for_doc_comments # categories: effective dart,style
- sort_constructors_first # categories: style
- sort_pub_dependencies # categories: pub
- sort_unnamed_constructors_first # categories: style
- test_types_in_equals # categories: error-prone
- throw_in_finally # categories: error-prone
- tighten_type_of_initializing_formals # categories: style
- type_annotate_public_apis # categories: effective dart,public interface
- type_init_formals # categories: effective dart,style
- type_literal_in_constant_pattern # categories: style
- unawaited_futures # categories: style
- unintended_html_in_doc_comment # categories: error-prone
- unnecessary_await_in_return # categories: style
- unnecessary_brace_in_string_interps # categories: brevity,style
- unnecessary_breaks # categories: brevity,style
- unnecessary_const # categories: brevity,style
- unnecessary_constructor_name # categories: brevity,style
- unnecessary_final # incompatibles: prefer_final_locals,prefer_final_parameters # categories: effective dart,style
- unnecessary_getters_setters # categories: effective dart,style
- unnecessary_lambdas # categories: style
- unnecessary_late # categories: style
- unnecessary_library_directive # categories: brevity
- unnecessary_library_name # categories: brevity,language feature usage,style
- unnecessary_new # categories: brevity,language feature usage,style
- unnecessary_null_aware_assignments # categories: brevity,effective dart,style
- unnecessary_null_aware_operator_on_extension_on_nullable # categories: style
- unnecessary_null_checks # categories: brevity,style
- unnecessary_null_in_if_null_operators # categories: style
- unnecessary_nullable_for_final_variable_declarations # categories: style
- unnecessary_overrides # categories: style
- unnecessary_parenthesis # categories: brevity,style
- unnecessary_raw_strings # categories: brevity,style
- unnecessary_statements # categories: brevity,unintentional
- unnecessary_string_escapes # categories: brevity,style
- unnecessary_string_interpolations # categories: brevity,style
- unnecessary_this # categories: brevity,effective dart,style
- unnecessary_to_list_in_spreads # categories: brevity
- unreachable_from_main # categories: unused code
- unrelated_type_equality_checks # categories: unintentional
- unsafe_html # categories: errors
- use_enums # categories: style
- use_function_type_syntax_for_parameters # categories: style
- use_if_null_to_convert_nulls_to_bools # categories: effective dart,style
- use_is_even_rather_than_modulo # categories: style
- use_late_for_private_fields_and_variables # categories: style
- use_named_constants # categories: style
- use_raw_strings # categories: style
- use_rethrow_when_possible # categories: brevity,effective dart
- use_setters_to_change_properties # categories: style
- use_string_buffers # categories: non-performant
- use_string_in_part_of_directives # categories: effective dart,style
- use_super_parameters # categories: brevity
- use_test_throws_matchers # categories: style
- use_to_and_as_if_applicable # categories: effective dart,style
- valid_regexps # categories: unintentional
- void_checks # categories: style
99 changes: 99 additions & 0 deletions packages/yumemi_lints/lib/dart/3.5/recommended.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# GENERATED CODE - DO NOT MODIFY BY HAND

include: package:yumemi_lints/dart/3.5/all.yaml

analyzer:
language:
# Increase safety as much as possible.
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
# By including all.yaml, some rules will conflict. These warnings will be addressed within this file.
included_file_warning: ignore

# Members annotated with `visibleForTesting` should not be referenced outside of the library in which they are declared or libraries within the test directory.
invalid_use_of_visible_for_testing_member: error

# Superclass members should not be unintentionally overridden, as this reduces readability.
annotate_overrides: error

# Class members should not be unintentionally redeclared, as this reduces readability.
annotate_redeclares: error

# When using implements, you do not inherit the method body of `==`, making it nearly impossible to follow the contract of `==`.
avoid_implementing_value_types: error

# Parameter names in overridden methods that do not match the original method's parameter names are usually considered typos.
avoid_renaming_method_parameters: error

# Shadowing type parameters should not be used, as this reduces readability.
avoid_shadowing_type_parameters: error

# Should not reference files that do not exist for conditional imports, as this will result in possible runtime failures.
conditional_uri_does_not_exist: error

# When importing a package, add it as a dependency in pubspec to impose constraints on the dependency, protecting against breaking changes.
depend_on_referenced_packages: error

# Some file systems are not case-sensitive, so many projects require filenames to be all lowercase.
file_names: error

# Files in the package's lib/src directory are not public APIs and should not be imported.
implementation_imports: error

# Some file systems are not case-sensitive, so many projects require filenames to be all lowercase.
library_names: error

# Super parameter names that do not match the parameter name of the corresponding super constructor are usually considered typos.
matching_super_parameters: error

# When unwrapping to a generic type parameter T, using `x!` can lead to a runtime error if T is given a nullable type, so you should use `x as T` instead.
null_check_on_nullable_type_parameter: error

# If package names are not determined according to the rules, unexpected problems may occur.
package_names: error

# Recursive getters are usually considered typos.
recursive_getters: error

# Should not be assigned to `void`.
void_checks: error

linter:
rules:
# Conflicts with enabling `avoid_types_on_closure_parameters`, `omit_local_variable_types`.
always_specify_types: false

# Conflicts with enabling `strict-raw-types`.
avoid_annotating_with_dynamic: false

# There are cases that are warned but not fixed by `dart fix`.
cascade_invocations: false

# Don't use Flutter-style todos.
flutter_style_todos: false

# May add more methods later.
one_member_abstracts: false

# Conflicts with enabling `prefer_single_quotes`.
prefer_double_quotes: false

# Using `=>` has sometimes to reduce readability.
prefer_expression_function_bodies: false

# Conflicts with enabling `avoid_final_parameters`.
prefer_final_parameters: false

# Conflicts with enabling `always_use_package_imports`.
prefer_relative_imports: false

# Don't often develop package.
public_member_api_docs: false

# Conflicts with enabling `prefer_final_locals`.
unnecessary_final: false

# Don't trigger warnings with methods for simple state updates, among other things.
use_setters_to_change_properties: false
27 changes: 12 additions & 15 deletions packages/yumemi_lints/lib/flutter/3.0/all.yaml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo-badge
Confirmed that there is no difference in the contents of all all.yaml's in Flutter.

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ include: package:yumemi_lints/dart/2.17/all.yaml

linter:
rules:
# Errors
- avoid_web_libraries_in_flutter
- diagnostic_describe_all_properties
- no_logic_in_create_state
- use_build_context_synchronously
- use_key_in_widget_constructors

# Style
- avoid_unnecessary_containers
- sized_box_for_whitespace
- sized_box_shrink_expand
- sort_child_properties_last
- use_colored_box
- use_decorated_box
- use_full_hex_values_for_flutter_colors
- avoid_unnecessary_containers # categories: flutter,style
- avoid_web_libraries_in_flutter # categories: error-prone,flutter,web
- diagnostic_describe_all_properties # categories: error-prone,flutter
- no_logic_in_create_state # categories: errors,flutter
- sized_box_for_whitespace # categories: flutter,style
- sized_box_shrink_expand # categories: flutter,style
- sort_child_properties_last # categories: flutter,style
- use_build_context_synchronously # categories: error-prone,flutter
- use_colored_box # categories: flutter,style
- use_decorated_box # categories: flutter,style
- use_full_hex_values_for_flutter_colors # categories: flutter,style
- use_key_in_widget_constructors # categories: flutter,style
27 changes: 12 additions & 15 deletions packages/yumemi_lints/lib/flutter/3.10/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ include: package:yumemi_lints/dart/3.0/all.yaml

linter:
rules:
# Errors
- avoid_web_libraries_in_flutter
- diagnostic_describe_all_properties
- no_logic_in_create_state
- use_build_context_synchronously
- use_key_in_widget_constructors

# Style
- avoid_unnecessary_containers
- sized_box_for_whitespace
- sized_box_shrink_expand
- sort_child_properties_last
- use_colored_box
- use_decorated_box
- use_full_hex_values_for_flutter_colors
- avoid_unnecessary_containers # categories: flutter,style
- avoid_web_libraries_in_flutter # categories: error-prone,flutter,web
- diagnostic_describe_all_properties # categories: error-prone,flutter
- no_logic_in_create_state # categories: errors,flutter
- sized_box_for_whitespace # categories: flutter,style
- sized_box_shrink_expand # categories: flutter,style
- sort_child_properties_last # categories: flutter,style
- use_build_context_synchronously # categories: error-prone,flutter
- use_colored_box # categories: flutter,style
- use_decorated_box # categories: flutter,style
- use_full_hex_values_for_flutter_colors # categories: flutter,style
- use_key_in_widget_constructors # categories: flutter,style
Loading
Loading