Skip to content

Commit e4bff21

Browse files
author
Peter Bryant
committed
Version 2.1.0
1 parent 41985de commit e4bff21

5 files changed

+228
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.1.0
2+
3+
- Remove requirement for public member API docs
4+
15
# 2.0.0
26

37
- Add [Dart Code Metrics](https://dartcodemetrics.dev)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To use the lints, add a dependency in your `pubspec.yaml`:
1010

1111
```yaml
1212
dev_dependencies:
13-
netsells_flutter_analysis: ^2.0.0
13+
netsells_flutter_analysis: ^2.1.0
1414
```
1515
1616
Then, add an include in `analysis_options.yaml`:
@@ -22,7 +22,7 @@ include: package:netsells_flutter_analysis/analysis_options.yaml
2222
This will ensure you always use the latest version of the lints. If you wish to restrict the lint version, specify a version of `analysis_options.yaml` instead:
2323

2424
```yaml
25-
include: package:netsells_flutter_analysis/analysis_options.2.0.0.yaml
25+
include: package:netsells_flutter_analysis/analysis_options.2.1.0.yaml
2626
```
2727

2828
## Suppressing Lints

lib/analysis_options.2.1.0.yaml

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
analyzer:
2+
plugins:
3+
- dart_code_metrics
4+
5+
strong-mode:
6+
implicit-casts: false
7+
implicit-dynamic: false
8+
9+
errors:
10+
close_sinks: ignore
11+
missing_required_param: error
12+
missing_return: error
13+
invalid_annotation_target: ignore
14+
15+
exclude:
16+
- test/.test_coverage.dart
17+
- lib/generated_plugin_registrant.dart
18+
- lib/**.*.dart
19+
- test/**.*.dart
20+
- build/**
21+
22+
linter:
23+
rules:
24+
- always_declare_return_types
25+
- always_require_non_null_named_parameters
26+
- always_use_package_imports
27+
- annotate_overrides
28+
- avoid_bool_literals_in_conditional_expressions
29+
- avoid_catching_errors
30+
- avoid_double_and_int_checks
31+
- avoid_dynamic_calls
32+
- avoid_empty_else
33+
- avoid_equals_and_hash_code_on_mutable_classes
34+
- avoid_escaping_inner_quotes
35+
- avoid_field_initializers_in_const_classes
36+
- avoid_function_literals_in_foreach_calls
37+
- avoid_init_to_null
38+
- avoid_js_rounded_ints
39+
- avoid_null_checks_in_equality_operators
40+
- avoid_positional_boolean_parameters
41+
- avoid_print
42+
- avoid_private_typedef_functions
43+
- avoid_redundant_argument_values
44+
- avoid_relative_lib_imports
45+
- avoid_renaming_method_parameters
46+
- avoid_return_types_on_setters
47+
- avoid_returning_null
48+
- avoid_returning_null_for_future
49+
- avoid_returning_null_for_void
50+
- avoid_returning_this
51+
- avoid_setters_without_getters
52+
- avoid_shadowing_type_parameters
53+
- avoid_single_cascade_in_expression_statements
54+
- avoid_slow_async_io
55+
- avoid_type_to_string
56+
- avoid_types_as_parameter_names
57+
- avoid_unnecessary_containers
58+
- avoid_unused_constructor_parameters
59+
- avoid_void_async
60+
- avoid_web_libraries_in_flutter
61+
- await_only_futures
62+
- camel_case_extensions
63+
- camel_case_types
64+
- cancel_subscriptions
65+
- cascade_invocations
66+
- cast_nullable_to_non_nullable
67+
- comment_references
68+
- constant_identifier_names
69+
- control_flow_in_finally
70+
- curly_braces_in_flow_control_structures
71+
- deprecated_consistency
72+
- directives_ordering
73+
- empty_catches
74+
- empty_constructor_bodies
75+
- empty_statements
76+
- eol_at_end_of_file
77+
- exhaustive_cases
78+
- file_names
79+
- hash_and_equals
80+
- implementation_imports
81+
- invariant_booleans
82+
- iterable_contains_unrelated_type
83+
- join_return_with_assignment
84+
- leading_newlines_in_multiline_strings
85+
- library_names
86+
- library_prefixes
87+
- lines_longer_than_80_chars
88+
- list_remove_unrelated_type
89+
- literal_only_boolean_expressions
90+
- missing_whitespace_between_adjacent_strings
91+
- no_adjacent_strings_in_list
92+
- no_default_cases
93+
- no_duplicate_case_values
94+
- no_logic_in_create_state
95+
- no_runtimeType_toString
96+
- non_constant_identifier_names
97+
- noop_primitive_operations
98+
- null_check_on_nullable_type_parameter
99+
- null_closures
100+
- omit_local_variable_types
101+
- only_throw_errors
102+
- overridden_fields
103+
- package_api_docs
104+
- package_names
105+
- package_prefixed_library_names
106+
- parameter_assignments
107+
- prefer_adjacent_string_concatenation
108+
- prefer_asserts_in_initializer_lists
109+
- prefer_asserts_with_message
110+
- prefer_collection_literals
111+
- prefer_conditional_assignment
112+
- prefer_const_constructors
113+
- prefer_const_constructors_in_immutables
114+
- prefer_const_declarations
115+
- prefer_const_literals_to_create_immutables
116+
- prefer_constructors_over_static_methods
117+
- prefer_contains
118+
- prefer_equal_for_default_values
119+
- prefer_final_fields
120+
- prefer_final_in_for_each
121+
- prefer_final_locals
122+
- prefer_for_elements_to_map_fromIterable
123+
- prefer_function_declarations_over_variables
124+
- prefer_generic_function_type_aliases
125+
- prefer_if_elements_to_conditional_expressions
126+
- prefer_if_null_operators
127+
- prefer_initializing_formals
128+
- prefer_inlined_adds
129+
- prefer_int_literals
130+
- prefer_interpolation_to_compose_strings
131+
- prefer_is_empty
132+
- prefer_is_not_empty
133+
- prefer_is_not_operator
134+
- prefer_iterable_whereType
135+
- prefer_null_aware_operators
136+
- prefer_null_aware_method_calls
137+
- prefer_single_quotes
138+
- prefer_spread_collections
139+
- prefer_typing_uninitialized_variables
140+
- prefer_void_to_null
141+
- provide_deprecation_message
142+
- recursive_getters
143+
- require_trailing_commas
144+
- sized_box_for_whitespace
145+
- slash_for_doc_comments
146+
- sort_child_properties_last
147+
- sort_constructors_first
148+
- sort_pub_dependencies
149+
- sort_unnamed_constructors_first
150+
- test_types_in_equals
151+
- throw_in_finally
152+
- tighten_type_of_initializing_formals
153+
- type_annotate_public_apis
154+
- type_init_formals
155+
- unawaited_futures
156+
- unnecessary_await_in_return
157+
- unnecessary_brace_in_string_interps
158+
- unnecessary_const
159+
- unnecessary_getters_setters
160+
- unnecessary_lambdas
161+
- unnecessary_new
162+
- unnecessary_null_aware_assignments
163+
- unnecessary_null_checks
164+
- unnecessary_null_in_if_null_operators
165+
- unnecessary_nullable_for_final_variable_declarations
166+
- unnecessary_overrides
167+
- unnecessary_parenthesis
168+
- unnecessary_raw_strings
169+
- unnecessary_statements
170+
- unnecessary_string_escapes
171+
- unnecessary_string_interpolations
172+
- unnecessary_this
173+
- unrelated_type_equality_checks
174+
- use_build_context_synchronously
175+
- use_full_hex_values_for_flutter_colors
176+
- use_function_type_syntax_for_parameters
177+
- use_is_even_rather_than_modulo
178+
- use_key_in_widget_constructors
179+
- use_late_for_private_fields_and_variables
180+
- use_named_constants
181+
- use_raw_strings
182+
- use_rethrow_when_possible
183+
- use_setters_to_change_properties
184+
- use_string_buffers
185+
- use_to_and_as_if_applicable
186+
- valid_regexps
187+
- void_checks
188+
189+
dart_code_metrics:
190+
metrics:
191+
cyclomatic-complexity: 20
192+
halstead-volume: 150
193+
lines-of-code: 150
194+
maintainability-index: 50
195+
maximum-nesting-level: 5
196+
number-of-methods: 10
197+
number-of-parameters: 4
198+
source-lines-of-code: 50
199+
weight-of-class: 0.33
200+
metrics-exclude:
201+
- test/**
202+
rules:
203+
- avoid-unnecessary-setstate
204+
- avoid-wrapping-in-padding
205+
- avoid-nested-conditional-expressions
206+
- avoid-unnecessary-type-assertions
207+
- avoid-unnecessary-type-casts
208+
- avoid-unrelated-type-assertions
209+
- avoid-unused-parameters
210+
- binary-expression-operand-order
211+
- double-literal-format
212+
- no-equal-then-else
213+
- prefer-conditional-expressions
214+
- prefer-first
215+
- prefer-immediate-return
216+
- prefer-last
217+
- prefer-trailing-comma
218+
anti-patterns:
219+
- long-method
220+
- long-parameter-list

lib/analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:netsells_flutter_analysis/analysis_options.2.0.0.yaml
1+
include: package:netsells_flutter_analysis/analysis_options.2.1.0.yaml

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: netsells_flutter_analysis
2-
version: 2.0.0
2+
version: 2.1.0
33
description: Static analysis rules for Dart and Flutter used at Netsells
44
repository: https://github.com/netsells/flutter-analysis
55
issue_tracker: https://github.com/netsells/flutter-analysis

0 commit comments

Comments
 (0)