Skip to content

Commit cb71f1d

Browse files
committed
Add .gitignore and analysis_options.yaml
1 parent c693f96 commit cb71f1d

File tree

2 files changed

+242
-0
lines changed

2 files changed

+242
-0
lines changed

.gitignore

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.DS_Store
2+
.atom/
3+
.idea/
4+
.vscode/
5+
6+
.packages
7+
.pub/
8+
.dart_tool/
9+
pubspec.lock
10+
flutter_export_environment.sh
11+
12+
examples/all_plugins/pubspec.yaml
13+
14+
Podfile
15+
Podfile.lock
16+
Pods/
17+
.symlinks/
18+
**/Flutter/App.framework/
19+
**/Flutter/ephemeral/
20+
**/Flutter/Flutter.framework/
21+
**/Flutter/Generated.xcconfig
22+
**/Flutter/flutter_assets/
23+
24+
ServiceDefinitions.json
25+
xcuserdata/
26+
**/DerivedData/
27+
28+
local.properties
29+
keystore.properties
30+
.gradle/
31+
gradlew
32+
gradlew.bat
33+
gradle-wrapper.jar
34+
.flutter-plugins-dependencies
35+
*.iml
36+
37+
generated_plugin_registrant.dart
38+
GeneratedPluginRegistrant.h
39+
GeneratedPluginRegistrant.m
40+
generated_plugin_registrant.cc
41+
GeneratedPluginRegistrant.java
42+
GeneratedPluginRegistrant.swift
43+
build/
44+
.flutter-plugins
45+
46+
.project
47+
.classpath
48+
.settings

analysis_options.yaml

+194
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# This file was copied from `flutter_tools/analysis_options.yaml` and should be
2+
# kept in sync.
3+
4+
analyzer:
5+
strong-mode:
6+
implicit-casts: false
7+
implicit-dynamic: false
8+
errors:
9+
# treat missing required parameters as a warning (not a hint)
10+
missing_required_param: warning
11+
# treat missing returns as a warning (not a hint)
12+
missing_return: warning
13+
# allow having TODOs in the code
14+
todo: ignore
15+
# allow self-reference to deprecated members (we do this because otherwise we have
16+
# to annotate every member in every test, assert, etc, when we deprecate something)
17+
deprecated_member_use_from_same_package: ignore
18+
# Ignore analyzer hints for updating pubspecs when using Future or
19+
# Stream and not importing dart:async
20+
# Please see https://github.com/flutter/flutter/pull/24528 for details.
21+
sdk_version_async_exported_from_core: ignore
22+
exclude:
23+
- "bin/cache/**"
24+
# the following two are relative to the stocks example and the flutter package respectively
25+
# see https://github.com/dart-lang/sdk/issues/28463
26+
- "lib/i18n/messages_*.dart"
27+
- "lib/src/http/**"
28+
29+
linter:
30+
rules:
31+
# these rules are documented on and in the same order as
32+
# the Dart Lint rules page to make maintenance easier
33+
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
34+
- always_declare_return_types
35+
- always_put_control_body_on_new_line
36+
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
37+
- always_require_non_null_named_parameters
38+
- always_specify_types
39+
- annotate_overrides
40+
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
41+
# - avoid_as # required for implicit-casts: true
42+
- avoid_bool_literals_in_conditional_expressions
43+
# - avoid_catches_without_on_clauses # we do this commonly
44+
# - avoid_catching_errors # we do this commonly
45+
- avoid_classes_with_only_static_members
46+
# - avoid_double_and_int_checks # only useful when targeting JS runtime
47+
- avoid_empty_else
48+
- avoid_equals_and_hash_code_on_mutable_classes
49+
- avoid_field_initializers_in_const_classes
50+
- avoid_function_literals_in_foreach_calls
51+
# - avoid_implementing_value_types # not yet tested
52+
- avoid_init_to_null
53+
# - avoid_js_rounded_ints # only useful when targeting JS runtime
54+
- avoid_null_checks_in_equality_operators
55+
# - avoid_positional_boolean_parameters # not yet tested
56+
# - avoid_print # not yet tested
57+
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
58+
# - avoid_redundant_argument_values # not yet tested
59+
- avoid_relative_lib_imports
60+
- avoid_renaming_method_parameters
61+
- avoid_return_types_on_setters
62+
# - avoid_returning_null # there are plenty of valid reasons to return null
63+
# - avoid_returning_null_for_future # not yet tested
64+
- avoid_returning_null_for_void
65+
# - avoid_returning_this # there are plenty of valid reasons to return this
66+
# - avoid_setters_without_getters # not yet tested
67+
# - avoid_shadowing_type_parameters # not yet tested
68+
- avoid_single_cascade_in_expression_statements
69+
- avoid_slow_async_io
70+
- avoid_types_as_parameter_names
71+
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
72+
# - avoid_unnecessary_containers # not yet tested
73+
- avoid_unused_constructor_parameters
74+
- avoid_void_async
75+
# - avoid_web_libraries_in_flutter # not yet tested
76+
- await_only_futures
77+
- camel_case_extensions
78+
- camel_case_types
79+
- cancel_subscriptions
80+
# - cascade_invocations # not yet tested
81+
# - close_sinks # not reliable enough
82+
# - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
83+
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
84+
- control_flow_in_finally
85+
# - curly_braces_in_flow_control_structures # not yet tested
86+
# - diagnostic_describe_all_properties # not yet tested
87+
- directives_ordering
88+
- empty_catches
89+
- empty_constructor_bodies
90+
- empty_statements
91+
# - file_names # not yet tested
92+
- flutter_style_todos
93+
- hash_and_equals
94+
- implementation_imports
95+
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
96+
- iterable_contains_unrelated_type
97+
# - join_return_with_assignment # not yet tested
98+
- library_names
99+
- library_prefixes
100+
# - lines_longer_than_80_chars # not yet tested
101+
- list_remove_unrelated_type
102+
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
103+
# - missing_whitespace_between_adjacent_strings # not yet tested
104+
- no_adjacent_strings_in_list
105+
- no_duplicate_case_values
106+
# - no_logic_in_create_state # not yet tested
107+
# - no_runtimeType_toString # not yet tested
108+
- non_constant_identifier_names
109+
# - null_closures # not yet tested
110+
# - omit_local_variable_types # opposite of always_specify_types
111+
# - one_member_abstracts # too many false positives
112+
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
113+
- overridden_fields
114+
- package_api_docs
115+
- package_names
116+
- package_prefixed_library_names
117+
# - parameter_assignments # we do this commonly
118+
- prefer_adjacent_string_concatenation
119+
- prefer_asserts_in_initializer_lists
120+
# - prefer_asserts_with_message # not yet tested
121+
- prefer_collection_literals
122+
- prefer_conditional_assignment
123+
- prefer_const_constructors
124+
- prefer_const_constructors_in_immutables
125+
- prefer_const_declarations
126+
- prefer_const_literals_to_create_immutables
127+
# - prefer_constructors_over_static_methods # not yet tested
128+
- prefer_contains
129+
# - prefer_double_quotes # opposite of prefer_single_quotes
130+
- prefer_equal_for_default_values
131+
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
132+
- prefer_final_fields
133+
- prefer_final_in_for_each
134+
- prefer_final_locals
135+
- prefer_for_elements_to_map_fromIterable
136+
- prefer_foreach
137+
# - prefer_function_declarations_over_variables # not yet tested
138+
- prefer_generic_function_type_aliases
139+
- prefer_if_elements_to_conditional_expressions
140+
- prefer_if_null_operators
141+
- prefer_initializing_formals
142+
- prefer_inlined_adds
143+
# - prefer_int_literals # not yet tested
144+
# - prefer_interpolation_to_compose_strings # not yet tested
145+
- prefer_is_empty
146+
- prefer_is_not_empty
147+
- prefer_is_not_operator
148+
- prefer_iterable_whereType
149+
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
150+
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932
151+
# - prefer_relative_imports # not yet tested
152+
- prefer_single_quotes
153+
- prefer_spread_collections
154+
- prefer_typing_uninitialized_variables
155+
- prefer_void_to_null
156+
# - provide_deprecation_message # not yet tested
157+
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
158+
- recursive_getters
159+
- slash_for_doc_comments
160+
# - sort_child_properties_last # not yet tested
161+
- sort_constructors_first
162+
- sort_pub_dependencies
163+
- sort_unnamed_constructors_first
164+
- test_types_in_equals
165+
- throw_in_finally
166+
# - type_annotate_public_apis # subset of always_specify_types
167+
- type_init_formals
168+
# - unawaited_futures # too many false positives
169+
# - unnecessary_await_in_return # not yet tested
170+
- unnecessary_brace_in_string_interps
171+
- unnecessary_const
172+
# - unnecessary_final # conflicts with prefer_final_locals
173+
- unnecessary_getters_setters
174+
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
175+
- unnecessary_new
176+
- unnecessary_null_aware_assignments
177+
- unnecessary_null_in_if_null_operators
178+
- unnecessary_overrides
179+
- unnecessary_parenthesis
180+
- unnecessary_statements
181+
- unnecessary_string_interpolations
182+
- unnecessary_this
183+
- unrelated_type_equality_checks
184+
# - unsafe_html # not yet tested
185+
- use_full_hex_values_for_flutter_colors
186+
# - use_function_type_syntax_for_parameters # not yet tested
187+
# - use_key_in_widget_constructors # not yet tested
188+
- use_late_for_private_fields_and_variables
189+
- use_rethrow_when_possible
190+
# - use_setters_to_change_properties # not yet tested
191+
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
192+
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
193+
- valid_regexps
194+
- void_checks

0 commit comments

Comments
 (0)