Skip to content

Commit f1f62eb

Browse files
committed
Adhere to DCM 1.10.0
1 parent 366707a commit f1f62eb

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 5.0.0
2+
- Adhere to DCM 1.10.0:
3+
- Add avoid-accessing-collections-by-constant-index
4+
- Add avoid-extensions-on-records
5+
- Add avoid-local-functions
6+
- Enable skip-checked-fields on avoid-non-null-assertion
7+
- Add avoid-nullable-parameters-with-default-values
8+
- Add avoid-unnecessary-late
9+
- Add avoid-wildcard-cases-with-enums
10+
- Add avoid-single-child-column-or-row
11+
- Add prefer-sliver-prefix
12+
- Add avoid-functions-in-register-singleton
13+
114
## 4.2.0
215
- Adhere to DCM 1.9.0:
316
- Add avoid-async-callback-in-fake-async

lib/dcm.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# version 1.8.0 - https://dcm.dev/changelog/
1+
# version 1.10.0 - https://dcm.dev/changelog/
22
dart_code_metrics:
33
rules:
44
### Common
55
# - arguments-ordering # way too pedantic
6+
- avoid-accessing-collections-by-constant-index
67
- avoid-accessing-other-classes-private-members
78
- avoid-async-call-in-sync-function
89
# - avoid-banned-file-names
@@ -24,6 +25,7 @@ dart_code_metrics:
2425
- avoid-equal-expressions
2526
- avoid-explicit-pattern-field-name
2627
# - avoid-explicit-type-declaration # public API
28+
- avoid-extensions-on-records
2729
- avoid-function-type-in-records
2830
- avoid-future-tostring
2931
- avoid-generics-shadowing
@@ -34,6 +36,8 @@ dart_code_metrics:
3436
- avoid-inverted-boolean-checks
3537
- avoid-keywords-in-wildcard-pattern
3638
# - avoid-late-keyword
39+
- avoid-local-functions
40+
# - avoid-long-files # hard to get the right settings
3741
# - avoid-long-functions # way too pedantic
3842
# - avoid-long-parameter-list: # way too pedantic
3943
# ignore-optional: true # exclude optional and (non-required) named parameters
@@ -56,9 +60,11 @@ dart_code_metrics:
5660
exclude:
5761
- test/**
5862
- avoid-non-null-assertion:
63+
skip-checked-fields: true
5964
exclude:
6065
- test/**
6166
- avoid-nullable-interpolation
67+
- avoid-nullable-parameters-with-default-values
6268
- avoid-one-field-records
6369
- avoid-passing-async-when-sync-expected:
6470
exclude:
@@ -90,7 +96,9 @@ dart_code_metrics:
9096
- avoid-unnecessary-call
9197
- avoid-unnecessary-conditionals
9298
- avoid-unnecessary-futures
99+
# - avoid-unnecessary-getter # it's ok to have getter for private field
93100
- avoid-unnecessary-if
101+
- avoid-unnecessary-late
94102
- avoid-unnecessary-negations
95103
- avoid-unnecessary-nullable-return-type
96104
- avoid-unnecessary-reassignment
@@ -104,6 +112,7 @@ dart_code_metrics:
104112
- avoid-unused-instances
105113
- avoid-unused-parameters
106114
- avoid-weak-cryptographic-algorithms
115+
- avoid-wildcard-cases-with-enums
107116
# - banned-usage
108117
- binary-expression-operand-order
109118
- double-literal-format
@@ -116,6 +125,7 @@ dart_code_metrics:
116125
exclude:
117126
- test/**
118127
- match-class-name-pattern
128+
# - match-getter-setter-field-names # forces API to equals internal code
119129
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
120130
- member-ordering:
121131
order:
@@ -179,7 +189,7 @@ dart_code_metrics:
179189
- prefer-correct-for-loop-increment
180190
- prefer-correct-future-return-type
181191
# - prefer-correct-identifier-length # way too pedantic
182-
# - prefer-correct-json-casts # overkill213
192+
# - prefer-correct-json-casts # overkill
183193
- prefer-correct-stream-return-type
184194
- prefer-correct-switch-length
185195
- prefer-correct-test-file-name
@@ -189,7 +199,7 @@ dart_code_metrics:
189199
- prefer-enums-by-name
190200
- prefer-explicit-parameter-names
191201
- prefer-first
192-
# - prefer-getter-over-method # TODO: triggers for private, to__(), as__() methods
202+
# - prefer-getter-over-method # way to pedantic
193203
- prefer-immediate-return
194204
- prefer-iterable-of
195205
- prefer-last
@@ -201,6 +211,7 @@ dart_code_metrics:
201211
exclude:
202212
- test/**
203213
- prefer-named-boolean-parameters
214+
# - prefer-named-imports # ok, but we don't have a usecase now
204215
- prefer-parentheses-with-if-null
205216
- prefer-public-exception-classes
206217
- prefer-return-await
@@ -237,6 +248,7 @@ dart_code_metrics:
237248
- avoid-recursive-widget-calls
238249
- avoid-returning-widgets
239250
- avoid-shrink-wrap-in-lists
251+
- avoid-single-child-column-or-row
240252
- avoid-state-constructors
241253
- avoid-stateless-widget-initialized-fields
242254
- avoid-unnecessary-overrides-in-state
@@ -254,6 +266,7 @@ dart_code_metrics:
254266
- prefer-extracting-callbacks
255267
- prefer-single-widget-per-file:
256268
ignore-private-widgets: true
269+
- prefer-sliver-prefix
257270
- prefer-text-rich
258271
- prefer-using-list-view
259272
# - prefer-widget-private-members # cannot use this.field in constructor
@@ -292,11 +305,16 @@ dart_code_metrics:
292305
## Fake Async
293306
- avoid-async-callback-in-fake-async
294307

308+
## Get It
309+
- avoid-functions-in-register-singleton:
310+
severity: error
311+
295312
### Intl - not used
296313
# - prefer-date-format
297314
# - prefer-intl-name
298315
# - prefer-number-format
299-
# - prefer-provide-intl-description
316+
# - prefer-providing-intl-description
317+
# - prefer-providing-intl-examples
300318
# - provide-correct-intl-args
301319

302320
### Angular - not used

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: 4.2.0
2+
version: 5.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)