Skip to content

Commit 4c6c7b8

Browse files
authored
Merge pull request #15 from netglade/feat/6.0.0
Release 6.0.0
2 parents f1f62eb + 72857b9 commit 4c6c7b8

File tree

3 files changed

+84
-19
lines changed

3 files changed

+84
-19
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## 6.0.0
2+
- Add DCM rule prefer-correct-error-name with `e` for error
3+
- Add DCM rule prefer-widget-private-members
4+
- Remove DCM rule banned-dependencies since we do not configure it (and add comment so we know it's ok)
5+
- Adhere to DCM 1.11.0 and 1.12.0:
6+
- Add avoid-duplicate-cascades
7+
- Add avoid-duplicate-switch-case-conditions
8+
- Add avoid-unnecessary-local-late
9+
- Add avoid-unnecessary-super
10+
- Add prefer-both-inlining-annotations
11+
- Add prefer-correct-callback-field-name
12+
- Add prefer-correct-error-name
13+
- Add prefer-correct-setter-parameter-name
14+
- Add prefer-explicit-function-type
15+
- Add prefer-specific-cases-first
16+
- Add prefer-typedefs-for-callbacks
17+
- Add prefer-unique-test-names
18+
- Add prefer-widget-private-members
19+
- Add avoid-inferrable-type-arguments
20+
- Add prefer-switch-with-enums
21+
- Add avoid-misused-test-matchers
22+
- Add prefer-any-or-every
23+
- Add avoid-duplicate-test-assertions
24+
- Add avoid-conditional-hooks
25+
- Add avoid-hooks-outside-build
26+
- Add prefer-use-prefix
27+
- Update function-always-returns-null - disable in useEffect
28+
129
## 5.0.0
230
- Adhere to DCM 1.10.0:
331
- Add avoid-accessing-collections-by-constant-index

lib/dcm.yaml

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
# version 1.10.0 - https://dcm.dev/changelog/
1+
# version 1.12.0 - https://dcm.dev/changelog/
22
dart_code_metrics:
33
rules:
44
### Common
55
# - arguments-ordering # way too pedantic
66
- avoid-accessing-collections-by-constant-index
77
- avoid-accessing-other-classes-private-members
88
- avoid-async-call-in-sync-function
9-
# - avoid-banned-file-names
10-
# - avoid-banned-imports
11-
# - avoid-banned-types
9+
# - avoid-banned-annotations # * OK, we just don't have global config
10+
# - avoid-banned-file-names # * OK, we just don't have global config
11+
# - avoid-banned-imports # * OK, we just don't have global config
12+
# - avoid-banned-types # * OK, we just don't have global config
1213
# - avoid-barrel-files # for now we use them
1314
- avoid-bottom-type-in-patterns
1415
- avoid-bottom-type-in-records
1516
- avoid-cascade-after-if-null
1617
- avoid-collapsible-if
1718
- avoid-collection-methods-with-unrelated-types
19+
# - avoid-collection-mutating-methods # sometimes it's ok
1820
- avoid-declaring-call-method
1921
- avoid-double-slash-imports
22+
- avoid-duplicate-cascades
2023
- avoid-duplicate-exports
2124
- avoid-duplicate-mixins
2225
- avoid-duplicate-named-imports
2326
- avoid-duplicate-patterns
27+
- avoid-duplicate-switch-case-conditions
28+
- avoid-duplicate-test-assertions
2429
- avoid-dynamic
2530
- avoid-equal-expressions
2631
- avoid-explicit-pattern-field-name
@@ -33,14 +38,19 @@ dart_code_metrics:
3338
- avoid-identical-exception-handling-blocks
3439
- avoid-ignoring-return-values
3540
- avoid-importing-entrypoint-exports
41+
- avoid-inferrable-type-arguments:
42+
ignored-invocations:
43+
- context.read
44+
- context.watch
45+
- GetIt.I
3646
- avoid-inverted-boolean-checks
3747
- avoid-keywords-in-wildcard-pattern
3848
# - avoid-late-keyword
3949
- avoid-local-functions
4050
# - avoid-long-files # hard to get the right settings
4151
# - avoid-long-functions # way too pedantic
4252
# - avoid-long-parameter-list: # way too pedantic
43-
# ignore-optional: true # exclude optional and (non-required) named parameters
53+
# ignore-optional: true # exclude optional and (non-required) named parameters
4454
- avoid-long-records
4555
- avoid-map-keys-contains
4656
- avoid-missed-calls
@@ -90,19 +100,20 @@ dart_code_metrics:
90100
- avoid-throw-in-catch-block
91101
- avoid-throw-objects-without-tostring
92102
- avoid-top-level-members-in-tests
93-
- avoid-unassigned-late-fields-keyword
103+
- avoid-unassigned-late-fields
94104
- avoid-uncaught-future-errors
95105
- avoid-unconditional-break
96106
- avoid-unnecessary-call
97107
- avoid-unnecessary-conditionals
98108
- avoid-unnecessary-futures
99109
# - avoid-unnecessary-getter # it's ok to have getter for private field
100110
- avoid-unnecessary-if
101-
- avoid-unnecessary-late
111+
- avoid-unnecessary-local-late
102112
- avoid-unnecessary-negations
103113
- avoid-unnecessary-nullable-return-type
104114
- avoid-unnecessary-reassignment
105115
- avoid-unnecessary-return
116+
- avoid-unnecessary-super
106117
- avoid-unnecessary-type-assertions
107118
- avoid-unnecessary-type-casts
108119
- avoid-unrelated-type-assertions
@@ -113,19 +124,22 @@ dart_code_metrics:
113124
- avoid-unused-parameters
114125
- avoid-weak-cryptographic-algorithms
115126
- avoid-wildcard-cases-with-enums
116-
# - banned-usage
127+
# - banned-usage # * OK, we just don't have global config
117128
- binary-expression-operand-order
118129
- double-literal-format
119130
- enum-constants-ordering
120131
- format-comment:
121132
only-doc-comments: true
122133
# - format-test-name # good but painful
123-
- function-always-returns-null
134+
- function-always-returns-null:
135+
ignored-invocations:
136+
- useEffect
124137
- map-keys-ordering:
125138
exclude:
126139
- test/**
127140
- match-class-name-pattern
128141
# - match-getter-setter-field-names # forces API to equals internal code
142+
# - match-lib-folder-structure # maybe later
129143
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
130144
- member-ordering:
131145
order:
@@ -181,25 +195,35 @@ dart_code_metrics:
181195
#- no-magic-number: # way too strict for default values of parameters etc.
182196
- no-object-declaration
183197
# - parameters-ordering # way too strict
198+
# - prefer-addition-subtraction-assignments # dunno
199+
- prefer-any-or-every
184200
- prefer-async-await
201+
- prefer-both-inlining-annotations
185202
- prefer-bytes-builder
186203
- prefer-commenting-analyzer-ignores
187204
- prefer-conditional-expressions
188-
# - prefer-correct-error-name # we use `e`
205+
- prefer-correct-callback-field-name
206+
- prefer-correct-error-name:
207+
allowed-names:
208+
- e
189209
- prefer-correct-for-loop-increment
190210
- prefer-correct-future-return-type
211+
# - prefer-correct-handler-name # not now
191212
# - prefer-correct-identifier-length # way too pedantic
192213
# - prefer-correct-json-casts # overkill
214+
- prefer-correct-setter-parameter-name
193215
- prefer-correct-stream-return-type
194216
- prefer-correct-switch-length
195217
- prefer-correct-test-file-name
196218
- prefer-correct-type-name
197219
- prefer-declaring-const-constructor
198220
- prefer-early-return
199221
- prefer-enums-by-name
222+
- prefer-explicit-function-type
200223
- prefer-explicit-parameter-names
224+
# - prefer-explicit-type-arguments # inference is better
201225
- prefer-first
202-
# - prefer-getter-over-method # way to pedantic
226+
# - prefer-getter-over-method # way too pedantic
203227
- prefer-immediate-return
204228
- prefer-iterable-of
205229
- prefer-last
@@ -211,25 +235,33 @@ dart_code_metrics:
211235
exclude:
212236
- test/**
213237
- prefer-named-boolean-parameters
214-
# - prefer-named-imports # ok, but we don't have a usecase now
238+
# - prefer-named-imports # * OK, we just don't have global config
239+
- prefer-null-aware-spread
215240
- prefer-parentheses-with-if-null
241+
# - prefer-prefixed-global-constants # * OK, we just don't have global config
216242
- prefer-public-exception-classes
217243
- prefer-return-await
218244
# - prefer-returning-conditional-expressions # annoying sometimes
219245
- prefer-simpler-patterns-null-check
246+
- prefer-specific-cases-first
220247
- prefer-static-class:
221248
ignore-private: true
222249
ignore-names:
223250
- (.*)Provider
224251
- use(.*)
252+
- prefer-switch-with-enums
225253
- prefer-test-matchers
226254
- prefer-trailing-comma
227-
# - prefer-type-over-var # we prefer inference
255+
# - prefer-type-over-var # we prefer type inference
256+
- prefer-typedefs-for-callbacks
257+
- prefer-unique-test-names
228258
# - prefer-unwrapping-future-or # we are ok with awaiting values
229259
- prefer-visible-for-testing-on-members
230260
- avoid-missing-interpolation:
231261
exclude:
232262
- test/**
263+
# - avoid-missing-test-files # * OK, but should be enabled per project
264+
- avoid-misused-test-matchers
233265
- prefer-wildcard-pattern
234266
- tag-name
235267
- unnecessary-trailing-comma:
@@ -269,7 +301,7 @@ dart_code_metrics:
269301
- prefer-sliver-prefix
270302
- prefer-text-rich
271303
- prefer-using-list-view
272-
# - prefer-widget-private-members # cannot use this.field in constructor
304+
- prefer-widget-private-members
273305
- proper-super-calls
274306
- use-setstate-synchronously
275307

@@ -302,13 +334,18 @@ dart_code_metrics:
302334
- prefer-custom-finder-over-find
303335
- prefer-symbol-over-key
304336

305-
## Fake Async
337+
### Fake Async
306338
- avoid-async-callback-in-fake-async
307339

308-
## Get It
340+
### Get It
309341
- avoid-functions-in-register-singleton:
310342
severity: error
311343

344+
### Flutter Hooks
345+
- avoid-conditional-hooks
346+
- avoid-hooks-outside-build
347+
- prefer-use-prefix
348+
312349
### Intl - not used
313350
# - prefer-date-format
314351
# - prefer-intl-name
@@ -326,9 +363,9 @@ dart_code_metrics:
326363
### Pubspec
327364
- avoid-any-version
328365
# - avoid-dependency-overrides
329-
- banned-dependencies
366+
# - banned-dependencies # * OK, we just don't have global config
330367
- prefer-caret-version-syntax
331-
# - prefer-correct-package-name
368+
# - prefer-correct-package-name # * OK, we just don't have global config
332369
- prefer-correct-screenshots
333370
- prefer-publish-to-none
334371
- prefer-semver-version

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: netglade_analysis
2-
version: 5.0.0
2+
version: 6.0.0
33
description: Lint rules for Dart and Flutter used internally at netglade.
44
repository: https://github.com/netglade/netglade_analysis
55
issue_tracker: https://github.com/netglade/netglade_analysis/issues

0 commit comments

Comments
 (0)