-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate from pedantic -> flutter_lints
- Loading branch information
1 parent
905cd94
commit 29a36d6
Showing
22 changed files
with
82 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1 @@ | ||
# pedantic has a strong foundation, but right now they only enable a small set of lints | ||
# we'll use them as a base, and add on the additional ones that our team has agreed upon. | ||
include: package:pedantic/analysis_options.yaml | ||
|
||
analyzer: | ||
strong-mode: | ||
implicit-dynamic: false | ||
errors: | ||
missing_required_param: warning | ||
missing_return: warning | ||
implementation_imports: warning | ||
todo: ignore | ||
exclude: | ||
|
||
linter: | ||
rules: | ||
# These are specified by effective dart guidelines, but are not yet in pedantic | ||
- avoid_classes_with_only_static_members | ||
# - avoid_catches_without_on_clauses -- pedeantic dart disagrees for valid reasons | ||
# - avoid_function_literals_in_foreach_calls | ||
- avoid_null_checks_in_equality_operators | ||
# - avoid_positional_boolean_parameters -- too many false positives, not enough of an issue | ||
- avoid_private_typedef_functions | ||
- avoid_returning_null | ||
- avoid_returning_this | ||
- avoid_setters_without_getters | ||
- camel_case_types | ||
- constant_identifier_names | ||
- directives_ordering | ||
- file_names | ||
- hash_and_equals | ||
- non_constant_identifier_names | ||
# - omit_local_variable_types | ||
- one_member_abstracts | ||
- package_api_docs | ||
- prefer_adjacent_string_concatenation | ||
- prefer_collection_literals | ||
- prefer_final_fields | ||
- prefer_function_declarations_over_variables | ||
- prefer_generic_function_type_aliases | ||
- prefer_initializing_formals | ||
- prefer_interpolation_to_compose_strings | ||
- public_member_api_docs | ||
- type_annotate_public_apis | ||
- unnecessary_brace_in_string_interps | ||
- unnecessary_getters_setters | ||
- unnecessary_lambdas | ||
- unnecessary_this | ||
# - use_setters_to_change_properties -- too many false positives... pedantic chose to not enforce it as well | ||
- use_to_and_as_if_applicable | ||
|
||
# These are not specified by pedantic dart | ||
- always_declare_return_types | ||
- always_put_control_body_on_new_line | ||
- always_require_non_null_named_parameters | ||
- annotate_overrides | ||
- avoid_field_initializers_in_const_classes | ||
- avoid_renaming_method_parameters | ||
- avoid_returning_null_for_void | ||
- avoid_slow_async_io | ||
- avoid_unused_constructor_parameters | ||
- avoid_void_async | ||
- cancel_subscriptions | ||
- control_flow_in_finally | ||
- empty_statements | ||
- flutter_style_todos | ||
- implementation_imports | ||
- iterable_contains_unrelated_type | ||
- list_remove_unrelated_type | ||
- no_adjacent_strings_in_list | ||
- overridden_fields | ||
- package_names | ||
- package_prefixed_library_names | ||
- prefer_asserts_in_initializer_lists | ||
- prefer_conditional_assignment | ||
- prefer_const_constructors | ||
- prefer_const_constructors_in_immutables | ||
- prefer_const_declarations | ||
- prefer_const_literals_to_create_immutables | ||
- prefer_final_locals | ||
- prefer_foreach | ||
- prefer_single_quotes | ||
- prefer_typing_uninitialized_variables | ||
- prefer_void_to_null | ||
- sort_constructors_first | ||
- sort_pub_dependencies | ||
- sort_unnamed_constructors_first | ||
- test_types_in_equals | ||
- throw_in_finally | ||
- unnecessary_null_aware_assignments | ||
- unnecessary_overrides | ||
- unnecessary_parenthesis | ||
- unnecessary_statements | ||
|
||
#Possible new rules to add | ||
- avoid_returning_null_for_future | ||
- literal_only_boolean_expressions | ||
# - always_put_required_named_parameters_first -- seems like a good idea, but requires adjusting a lot of code | ||
- avoid_bool_literals_in_conditional_expressions | ||
- avoid_catching_errors | ||
# - avoid_types_on_closure_parameters -- is great most of the time, but is necessary often in tests... we should review | ||
# - cascade_invocations -- is great for production code... causes a lot of noise with GWT in tests -- puts multiple thens in a single line | ||
- join_return_with_assignment | ||
- only_throw_errors | ||
- parameter_assignments | ||
- prefer_constructors_over_static_methods | ||
# - prefer_expression_function_bodies -- LINTs on widget build methods... | ||
- prefer_final_in_for_each | ||
- prefer_for_elements_to_map_fromIterable | ||
- prefer_if_elements_to_conditional_expressions | ||
- prefer_if_null_operators | ||
- prefer_inlined_adds | ||
- prefer_null_aware_operators | ||
- prefer_spread_collections | ||
- provide_deprecation_message | ||
- sort_child_properties_last | ||
- unnecessary_await_in_return | ||
- prefer_relative_imports | ||
- avoid_equals_and_hash_code_on_mutable_classes | ||
- avoid_unnecessary_containers | ||
- prefer_is_not_operator | ||
include: package:flutter_lints/flutter.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.