Skip to content

Commit 75bce97

Browse files
authored
Merge pull request #16 from netglade/feat/7.0.0
Version 7.0.0
2 parents 4c6c7b8 + 962f772 commit 75bce97

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 7.0.0
2+
- Adhere to DCM 1.13.0:
3+
- Add avoid-duplicate-collection-elements
4+
- Add avoid-duplicate-initializers
5+
- Add avoid-duplicate-map-keys
6+
- Add avoid-nullable-tostring
7+
- Add avoid-unused-after-null-check
8+
- Add move-variable-outside-iteration
9+
- Add avoid-undisposed-instances
10+
- Add avoid-unassigned-stream-subscriptions
11+
- Update prefer-switch-with-enums with `ignore-contains: true`
12+
- Remove DCM rules `match-class-name-pattern`, `tag-name`, `add-copy-with`, and `extend-equatable`, since we do not configure it (and added comment so we know it's ok)
13+
114
## 6.0.0
215
- Add DCM rule prefer-correct-error-name with `e` for error
316
- Add DCM rule prefer-widget-private-members

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.0.1
33
publish_to: none
44

55
environment:
6-
sdk: ">=2.18.0 <3.0.0"
6+
sdk: ">=2.18.0 <4.0.0"
77

88
dependencies:
99
netglade_analysis:

lib/dcm.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# version 1.12.0 - https://dcm.dev/changelog/
1+
# version 1.13.0 - https://dcm.dev/changelog/
22
dart_code_metrics:
33
rules:
44
### Common
@@ -20,7 +20,10 @@ dart_code_metrics:
2020
- avoid-declaring-call-method
2121
- avoid-double-slash-imports
2222
- avoid-duplicate-cascades
23+
- avoid-duplicate-collection-elements
2324
- avoid-duplicate-exports
25+
- avoid-duplicate-initializers
26+
- avoid-duplicate-map-keys
2427
- avoid-duplicate-mixins
2528
- avoid-duplicate-named-imports
2629
- avoid-duplicate-patterns
@@ -75,6 +78,7 @@ dart_code_metrics:
7578
- test/**
7679
- avoid-nullable-interpolation
7780
- avoid-nullable-parameters-with-default-values
81+
- avoid-nullable-tostring
7882
- avoid-one-field-records
7983
- avoid-passing-async-when-sync-expected:
8084
exclude:
@@ -101,6 +105,7 @@ dart_code_metrics:
101105
- avoid-throw-objects-without-tostring
102106
- avoid-top-level-members-in-tests
103107
- avoid-unassigned-late-fields
108+
- avoid-unassigned-stream-subscriptions
104109
- avoid-uncaught-future-errors
105110
- avoid-unconditional-break
106111
- avoid-unnecessary-call
@@ -119,6 +124,7 @@ dart_code_metrics:
119124
- avoid-unrelated-type-assertions
120125
- avoid-unrelated-type-casts
121126
- avoid-unsafe-collection-methods
127+
- avoid-unused-after-null-check
122128
- avoid-unused-generics
123129
- avoid-unused-instances
124130
- avoid-unused-parameters
@@ -137,7 +143,7 @@ dart_code_metrics:
137143
- map-keys-ordering:
138144
exclude:
139145
- test/**
140-
- match-class-name-pattern
146+
# - match-class-name-pattern # * OK, we just don't have global config
141147
# - match-getter-setter-field-names # forces API to equals internal code
142148
# - match-lib-folder-structure # maybe later
143149
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
@@ -170,6 +176,7 @@ dart_code_metrics:
170176
min-fields: 3
171177
min-occurrences: 3
172178
- move-variable-closer-to-its-usage
179+
- move-variable-outside-iteration
173180
- newline-before-case
174181
- newline-before-return
175182
- no-boolean-literal-compare:
@@ -238,7 +245,7 @@ dart_code_metrics:
238245
# - prefer-named-imports # * OK, we just don't have global config
239246
- prefer-null-aware-spread
240247
- prefer-parentheses-with-if-null
241-
# - prefer-prefixed-global-constants # * OK, we just don't have global config
248+
# - prefer-prefixed-global-constants # * OK, we just don't have global config
242249
- prefer-public-exception-classes
243250
- prefer-return-await
244251
# - prefer-returning-conditional-expressions # annoying sometimes
@@ -249,7 +256,8 @@ dart_code_metrics:
249256
ignore-names:
250257
- (.*)Provider
251258
- use(.*)
252-
- prefer-switch-with-enums
259+
- prefer-switch-with-enums:
260+
ignore-contains: true
253261
- prefer-test-matchers
254262
- prefer-trailing-comma
255263
# - prefer-type-over-var # we prefer type inference
@@ -263,12 +271,12 @@ dart_code_metrics:
263271
# - avoid-missing-test-files # * OK, but should be enabled per project
264272
- avoid-misused-test-matchers
265273
- prefer-wildcard-pattern
266-
- tag-name
274+
# - tag-name # * OK, we just don't have global config
267275
- unnecessary-trailing-comma:
268276
max-width: 80
269277

270278
### Flutter
271-
- add-copy-with
279+
# - add-copy-with # * OK, we just don't have global config
272280
- always-remove-listener
273281
- avoid-border-all
274282
- avoid-empty-setstate
@@ -283,6 +291,7 @@ dart_code_metrics:
283291
- avoid-single-child-column-or-row
284292
- avoid-state-constructors
285293
- avoid-stateless-widget-initialized-fields
294+
- avoid-undisposed-instances
286295
- avoid-unnecessary-overrides-in-state
287296
- avoid-unnecessary-setstate
288297
- avoid-unnecessary-stateful-widgets
@@ -321,7 +330,7 @@ dart_code_metrics:
321330
- prefer-multi-bloc-provider
322331

323332
### Equatable
324-
- extend-equatable
333+
# - extend-equatable # * OK, we just don't have global config
325334
- list-all-equatable-fields
326335

327336
### Flame - not used

lib/netglade_analysis.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore_for_file: unused-files
2+
13
/// NetGlade Dart and Flutter analyzer settings and best practices
24
/// used internally at [netglade](https://netglade.com).
35
library netglade_analysis;

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