-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis_options.yaml
More file actions
237 lines (229 loc) · 6.88 KB
/
Copy pathanalysis_options.yaml
File metadata and controls
237 lines (229 loc) · 6.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
rules:
avoid_redundant_argument_values: true
avoid_print: true
file_names: true
no_duplicate_case_values: true
prefer_relative_imports: true
prefer_single_quotes: true
sized_box_for_whitespace: true
always_declare_return_types: true
require_trailing_commas: true
use_super_parameters: true
directives_ordering: true
analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
exclude:
- lib/**.g.dart
- lib/**.config.dart
- lib/**.freezed.dart
- lib/main.dart
plugins:
- dart_code_metrics
dart_code_metrics:
anti-patterns:
# - long-parameter-list:
# severity: style
# exclude:
# - test/**
metrics:
- cyclomatic-complexity: 20
- halstead-volume: 150
- lines-of-code: 100
- maintainability-index: 50
- maximum-nesting-level: 4
- number-of-methods: 10
- number-of-parameters: 4
- source-lines-of-code: 50
- technical-debt:
threshold: 1
todo-cost: 160
ignore-cost: 160
ignore-for-file-cost: 160
as-dynamic-cost: 40
deprecated-annotations-cost: 80
file-nullsafety-migration-cost: 160
unit-type: 'BRL'
- weight-of-class: 0.33
rules:
# # UNNECESSARY STYLE
# # - arguments-ordering
# COMMON
# - avoid-banned-imports
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
- avoid-duplicate-exports
- avoid-dynamic
- avoid-global-state
- avoid-ignoring-return-values
- avoid-late-keyword
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions
- avoid-non-ascii-symbols
- avoid-non-null-assertion
- avoid-passing-async-when-sync-expected
- avoid-redundant-async
# - avoid-substring
- avoid-throw-in-catch-block
- avoid-top-level-members-in-tests
- avoid-unnecessary-conditionals
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
# - ban-name
- binary-expression-operand-order
- double-literal-format
- format-comment
- list-all-equatable-fields
- member-ordering
- missing-test-assertion
- newline-before-return
- no-boolean-literal-compare
- no-empty-block
- no-equal-arguments
- no-equal-then-else
- no-magic-number
- no-object-declaration
- prefer-async-await
- prefer-commenting-analyzer-ignores
- prefer-conditional-expressions
- prefer-correct-identifier-length
- prefer-correct-test-file-name
- prefer-correct-type-name
- prefer-enums-by-name
- prefer-first
- prefer-last
- prefer-immediate-return
- prefer-iterable-of
- prefer-match-file-name
- prefer-moving-to-variable
- prefer-static-class
- prefer-trailing-comma
- tag-name
# FLUTTER
- always-remove-listener
- avoid-border-all
- avoid-returning-widgets
- avoid-shrink-wrap-in-lists
- avoid-unnecessary-setstate
- use-setstate-synchronously
- avoid-expanded-as-spacer
- avoid-wrapping-in-padding
- check-for-equals-in-render-object-setters
- consistent-update-render-object
- prefer-const-border-radius
- prefer-correct-edge-insets-constructor
- prefer-extracting-callbacks
- prefer-single-widget-per-file
- prefer-using-list-view
# - avoid-cascade-after-if-null
# - avoid-unnecessary-conditionals
# - avoid-unnecessary-type-assertions
# - avoid-unrelated-type-assertions
# - avoid-unused-parameters
# - binary-expression-operand-order
# - double-literal-format
# - newline-before-return
# - no-boolean-literal-compare
# - no-empty-block
# - no-equal-then-else
# - prefer-commenting-analyzer-ignores
# - prefer-correct-test-file-name
# - prefer-enums-by-name
# - prefer-first
# - prefer-immediate-return
# - prefer-last
# - always-remove-listener
# - avoid-shrink-wrap-in-lists
# - avoid-unnecessary-setstate
# - use-setstate-synchronously
# - prefer-correct-edge-insets-constructor
# - avoid-expanded-as-spacer
# - prefer-using-list-view
# - format-comment:
# only-doc-comments: true
# ignored-patterns:
# - ^ cSpell.*
# - avoid-late-keyword:
# exclude:
# - test/**
# - avoid-nested-conditional-expressions:
# acceptable-level: 2
# - avoid-top-level-members-in-tests:
# exclude:
# - lib/**
# - bin/**
# - member-ordering:
# alphabetize: true
# order:
# - constructors
# - private-fields
# - public-fields
# - close-method
# - dispose-method
# widgets-order:
# - constructor
# - init-state-method
# - did-change-dependencies-method
# - did-update-widget-method
# - build-method
# - dispose-method
# - ban-name:
# entries:
# - ident: showDialog
# description: Please use myShowDialog in this package
# - ident: _height
# description: Please use myShowDialog in this package
# - ident: _width
# description: Please use myShowDialog in this package
# - ident: DateTime.now
# description: Please use a Clock.now instead
# - no-magic-number:
# allowed: [0, 1000]
# allow-only-once: true
# - prefer-correct-identifier-length:
# exceptions: []
# max-identifier-length: 30
# min-identifier-length: 3
# - prefer-correct-type-name:
# excluded: []
# min-length: 3
# max-length: 40
# - prefer-match-file-name:
# exclude:
# - test/**
# - prefer-static-class:
# ignore-annotations:
# - allowedAnnotation
# ignore-private: true
# ignore-names:
# - (.*)Provider
# - use(.*)
# - prefer-trailing-comma:
# break-on: 3
# - avoid-returning-widgets:
# ignored-names:
# - testFunction
# ignored-annotations:
# - allowedAnnotation
# - prefer-single-widget-per-file:
# ignore-private-widgets: true
# # NEW
# - prefer-provide-intl-description
# - correct-game-instantiating
# - avoid-initializing-in-on-mount
# - avoid-creating-vector-in-update
# - prefer-define-hero-tag