Skip to content

Commit e99e440

Browse files
committed
Adhere to DCM 1.7.0
1 parent 87f85ec commit e99e440

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

lib/dcm.yaml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ dart_code_metrics:
1414
rules:
1515
### Common
1616
# - arguments-ordering # way too pedantic
17+
# - avoid-accessing-other-classes-private-members # TODO?
1718
# - avoid-banned-file-names
1819
# - avoid-banned-imports
1920
# - avoid-banned-types
21+
- avoid-barrel-files # TODO?
2022
- avoid-bottom-type-in-patterns
2123
- avoid-bottom-type-in-records
2224
- avoid-cascade-after-if-null
@@ -33,23 +35,33 @@ dart_code_metrics:
3335
# - avoid-explicit-type-declaration # public API
3436
- avoid-function-type-in-records
3537
- avoid-future-tostring
38+
- avoid-generics-shadowing
3639
- avoid-global-state
3740
- avoid-ignoring-return-values
41+
- avoid-importing-entrypoint-exports
3842
- avoid-inverted-boolean-checks
43+
- avoid-keywords-in-wildcard-pattern
3944
# - avoid-late-keyword
4045
# - avoid-long-functions # way too pedantic
41-
- avoid-long-parameter-list:
42-
ignore-optional: true # exclude optional and (required) named parameters
46+
# - avoid-long-parameter-list: # TODO: ?
47+
# ignore-optional: true # exclude optional and (non-required) named parameters
4348
- avoid-long-records
4449
- avoid-missed-calls
4550
- avoid-missing-enum-constant-in-map
51+
- avoid-misused-wildcard-pattern
4652
- avoid-mixing-named-and-positional-fields
53+
# - avoid-mutating-parameters # TODO: ?
54+
# - avoid-negated-conditions # TODO: ?
4755
- avoid-nested-conditional-expressions:
4856
acceptable-level: 2
57+
- avoid-nested-futures
4958
- avoid-nested-records
59+
- avoid-nested-streams-and-futures
5060
- avoid-nested-switch-expressions
5161
- avoid-nested-switches
52-
- avoid-non-ascii-symbols
62+
- avoid-non-ascii-symbols:
63+
exclude:
64+
- test/**
5365
- avoid-non-null-assertion:
5466
exclude:
5567
- test/**
@@ -64,6 +76,7 @@ dart_code_metrics:
6476
- avoid-redundant-pragma-inline
6577
- avoid-self-assignment
6678
- avoid-self-compare
79+
- avoid-shadowed-extension-methods
6780
- avoid-shadowing:
6881
ignore-parameters: true
6982
ignored-names:
@@ -74,7 +87,10 @@ dart_code_metrics:
7487
- avoid-throw-objects-without-tostring
7588
- avoid-top-level-members-in-tests
7689
- avoid-unassigned-late-fields-keyword
90+
- avoid-uncaught-future-errors
91+
- avoid-unnecessary-call
7792
- avoid-unnecessary-conditionals
93+
- avoid-unnecessary-futures
7894
- avoid-unnecessary-negations
7995
- avoid-unnecessary-nullable-return-type
8096
- avoid-unnecessary-return
@@ -92,6 +108,7 @@ dart_code_metrics:
92108
only-doc-comments: true
93109
# - format-test-name # good but painful
94110
- function-always-returns-null
111+
- map-keys-ordering # TODO?
95112
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
96113
- member-ordering:
97114
order:
@@ -122,7 +139,8 @@ dart_code_metrics:
122139
min-fields: 3
123140
min-occurrences: 3
124141
- newline-before-return
125-
- no-boolean-literal-compare
142+
- no-boolean-literal-compare:
143+
allow-false: true # allows `variable == false` instead of just `!variable`
126144
- no-empty-block
127145
- no-equal-arguments:
128146
ignored-parameters:
@@ -137,6 +155,7 @@ dart_code_metrics:
137155
- bottomLeft
138156
- bottomRight
139157
- no-equal-conditions
158+
- no-equal-nested-conditions
140159
- no-equal-switch-case
141160
- no-equal-switch-expression-cases
142161
- no-equal-then-else
@@ -146,7 +165,10 @@ dart_code_metrics:
146165
- prefer-bytes-builder
147166
- prefer-commenting-analyzer-ignores
148167
- prefer-conditional-expressions
168+
- prefer-correct-error-name # TODO: ?
169+
- prefer-correct-future-return-type
149170
# - prefer-correct-identifier-length # way too pedantic
171+
- prefer-correct-stream-return-type
150172
- prefer-correct-switch-length
151173
- prefer-correct-test-file-name
152174
- prefer-correct-type-name
@@ -163,6 +185,9 @@ dart_code_metrics:
163185
- test/**
164186
- prefer-moving-to-variable:
165187
allowed-duplicated-chains: 3
188+
exclude:
189+
- test/**
190+
- prefer-parentheses-with-if-null
166191
- prefer-return-await
167192
# - prefer-returning-conditional-expressions # annoying sometimes
168193
- prefer-simpler-patterns-null-check
@@ -172,7 +197,8 @@ dart_code_metrics:
172197
- (.*)Provider
173198
- use(.*)
174199
- prefer-test-matchers
175-
# - prefer-trailing-comma # already in Dart lints - require_trailing_commas
200+
- prefer-trailing-comma
201+
# - prefer-type-over-var # we prefer inference
176202
# - prefer-unwrapping-future-or # we are ok with awaiting values
177203
- prefer-visible-for-testing-on-members
178204
- prefer-wildcard-pattern
@@ -189,10 +215,12 @@ dart_code_metrics:
189215
- avoid-incomplete-copy-with
190216
- avoid-inherited-widget-in-initstate
191217
- avoid-late-context
218+
- avoid-missing-image-alt # TODO?
192219
- avoid-returning-widgets
193220
- avoid-shrink-wrap-in-lists
194221
- avoid-state-constructors
195222
- avoid-stateless-widget-initialized-fields
223+
- avoid-unnecessary-overrides-in-state # TODO?
196224
- avoid-unnecessary-setstate
197225
- avoid-unnecessary-stateful-widgets
198226
- avoid-wrapping-in-padding
@@ -202,6 +230,7 @@ dart_code_metrics:
202230
- prefer-action-button-tooltip
203231
- prefer-const-border-radius
204232
- prefer-correct-edge-insets-constructor
233+
- prefer-dedicated-media-query-methods
205234
- prefer-define-hero-tag
206235
- prefer-extracting-callbacks
207236
- prefer-single-widget-per-file:

lib/netglade_analysis.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// NetGlade Dart and Flutter analyzer settings and best practices
2-
/// used internally at [netglade](https://netglade.cz/en).
2+
/// used internally at [netglade](https://netglade.com).
33
library netglade_analysis;

0 commit comments

Comments
 (0)