Skip to content

Commit 6456908

Browse files
committed
Adhere to DCM 1.9.0
1 parent 7d7bd14 commit 6456908

File tree

3 files changed

+59
-17
lines changed

3 files changed

+59
-17
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 4.2.0
2+
- Adhere to DCM 1.9.0:
3+
- Add avoid-async-callback-in-fake-async
4+
- Add move-variable-closer-to-its-usage
5+
- Add avoid-passing-self-as-argument
6+
- Add avoid-referencing-discarded-variables
7+
- Add avoid-unconditional-break
8+
- Add avoid-weak-cryptographic-algorithms
9+
- Add avoid-identical-exception-handling-blocks
10+
- Add avoid-recursive-calls
11+
- Add avoid-missing-interpolation
12+
- Add avoid-unnecessary-if
13+
114
## 4.1.0
215
- Temporarily remove (its WIP and not recognized):
316
- no_wildcard_variable_uses

lib/dcm.yaml

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
# version 1.8.0 - https://dcm.dev/changelog/
22
dart_code_metrics:
3-
pubspec-rules:
4-
### Pubspec
5-
- avoid-any-version
6-
# - avoid-dependency-overrides
7-
- banned-dependencies
8-
- prefer-caret-version-syntax
9-
# - prefer-correct-package-name
10-
- prefer-correct-screenshots
11-
- prefer-publish-to-none
12-
- prefer-semver-version
13-
143
rules:
154
### Common
165
# - arguments-ordering # way too pedantic
@@ -39,6 +28,7 @@ dart_code_metrics:
3928
- avoid-future-tostring
4029
- avoid-generics-shadowing
4130
- avoid-global-state
31+
- avoid-identical-exception-handling-blocks
4232
- avoid-ignoring-return-values
4333
- avoid-importing-entrypoint-exports
4434
- avoid-inverted-boolean-checks
@@ -73,11 +63,15 @@ dart_code_metrics:
7363
- avoid-passing-async-when-sync-expected:
7464
exclude:
7565
- test/**
66+
- avoid-passing-default-values # TODO: auto fix removes only value, not named part
67+
- avoid-passing-self-as-argument
7668
- avoid-positional-record-field-access
69+
- avoid-recursive-calls
7770
- avoid-redundant-async
7871
- avoid-redundant-else
7972
- avoid-redundant-positional-field-name
8073
- avoid-redundant-pragma-inline
74+
- avoid-referencing-discarded-variables
8175
- avoid-self-assignment
8276
- avoid-self-compare
8377
- avoid-shadowed-extension-methods
@@ -92,9 +86,11 @@ dart_code_metrics:
9286
- avoid-top-level-members-in-tests
9387
- avoid-unassigned-late-fields-keyword
9488
- avoid-uncaught-future-errors
89+
- avoid-unconditional-break
9590
- avoid-unnecessary-call
9691
- avoid-unnecessary-conditionals
9792
- avoid-unnecessary-futures
93+
- avoid-unnecessary-if
9894
- avoid-unnecessary-negations
9995
- avoid-unnecessary-nullable-return-type
10096
- avoid-unnecessary-reassignment
@@ -107,6 +103,7 @@ dart_code_metrics:
107103
- avoid-unused-generics
108104
- avoid-unused-instances
109105
- avoid-unused-parameters
106+
- avoid-weak-cryptographic-algorithms
110107
# - banned-usage
111108
- binary-expression-operand-order
112109
- double-literal-format
@@ -148,12 +145,13 @@ dart_code_metrics:
148145
- move-records-to-typedefs:
149146
min-fields: 3
150147
min-occurrences: 3
148+
- move-variable-closer-to-its-usage
151149
- newline-before-case
152150
- newline-before-return
153151
- no-boolean-literal-compare:
154152
allow-false: true # allows `variable == false` instead of just `!variable`
155153
- no-empty-block
156-
# - no-equal-arguments: # TODO: hard to set up so it makes sense
154+
# - no-equal-arguments: # hard to set up so it makes sense
157155
# ignored-parameters:
158156
# - height
159157
# - width
@@ -170,8 +168,9 @@ dart_code_metrics:
170168
- no-equal-switch-case
171169
- no-equal-switch-expression-cases
172170
- no-equal-then-else
173-
#- no-magic-number: # way to strict for default values of parameters etc.
171+
#- no-magic-number: # way too strict for default values of parameters etc.
174172
- no-object-declaration
173+
# - parameters-ordering # way too strict
175174
- prefer-async-await
176175
- prefer-bytes-builder
177176
- prefer-commenting-analyzer-ignores
@@ -190,6 +189,7 @@ dart_code_metrics:
190189
- prefer-enums-by-name
191190
- prefer-explicit-parameter-names
192191
- prefer-first
192+
# - prefer-getter-over-method # TODO: triggers for private, to__(), as__() methods
193193
- prefer-immediate-return
194194
- prefer-iterable-of
195195
- prefer-last
@@ -216,6 +216,9 @@ dart_code_metrics:
216216
# - prefer-type-over-var # we prefer inference
217217
# - prefer-unwrapping-future-or # we are ok with awaiting values
218218
- prefer-visible-for-testing-on-members
219+
- avoid-missing-interpolation:
220+
exclude:
221+
- test/**
219222
- prefer-wildcard-pattern
220223
- tag-name
221224
- unnecessary-trailing-comma:
@@ -277,11 +280,37 @@ dart_code_metrics:
277280
- list-all-equatable-fields
278281

279282
### Flame - not used
283+
# - avoid-creating-vector-in-update
284+
# - avoid-initializing-in-on-mount
285+
# - avoid-redundant-async-on-load
286+
# - correct-game-instantiating
287+
288+
### Patrol
289+
- prefer-custom-finder-over-find
290+
- prefer-symbol-over-key
291+
292+
## Fake Async
293+
- avoid-async-callback-in-fake-async
280294

281295
### Intl - not used
296+
# - prefer-date-format
297+
# - prefer-intl-name
298+
# - prefer-number-format
299+
# - prefer-provide-intl-description
300+
# - provide-correct-intl-args
282301

283302
### Angular - not used
303+
# - avoid-preserve-whitespace-false
304+
# - component-annotation-arguments-ordering
305+
# - prefer-on-push-cd-strategy
284306

285-
### Patrol
286-
- prefer-custom-finder-over-find
287-
- prefer-symbol-over-key
307+
pubspec-rules:
308+
### Pubspec
309+
- avoid-any-version
310+
# - avoid-dependency-overrides
311+
- banned-dependencies
312+
- prefer-caret-version-syntax
313+
# - prefer-correct-package-name
314+
- prefer-correct-screenshots
315+
- prefer-publish-to-none
316+
- 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: 4.1.0
2+
version: 4.2.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)