Skip to content

Commit 142512a

Browse files
authored
Merge pull request #31 from netglade/feat/adhere-dcm-1.15.0
Adhere to DCM 1.15.0
2 parents 5d94851 + 181a318 commit 142512a

File tree

8 files changed

+68
-36
lines changed

8 files changed

+68
-36
lines changed

.fvm/fvm_config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"flutterSdkVersion": "3.19.0",
3-
"flavors": {}
2+
"flutterSdkVersion": "3.19.4"
43
}

.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.19.4"
3+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ melos_my_project.iml
77
.vscode/*
88
!.vscode/tasks.json
99
!.vscode/settings.json
10-
.fvm/flutter_sdk
10+
.fvm/
1111

1212
.packages
1313
.pub/

.vscode/settings.json

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
{
2-
"dart.flutterSdkPath": ".fvm/flutter_sdk",
3-
"search.exclude": {
4-
"**/.fvm": true,
5-
"**/*.g.dart": true,
6-
},
7-
"files.exclude": {
8-
"**/.git": true,
9-
"**/.DS_Store": true,
10-
".idea/**": true,
11-
".run/**": true,
12-
},
13-
// Remove from file watching
14-
"files.watcherExclude": {
15-
"**/.fvm": true
16-
},
17-
"dart.lineLength": 120,
18-
"editor.rulers": [
19-
120
20-
],
21-
"yaml.schemas": {
22-
"https://json.schemastore.org/dart-build.json": [
23-
"build.yaml"
24-
]
25-
},
26-
"explorer.fileNesting.enabled": true,
27-
"explorer.fileNesting.patterns": {
28-
"*.dart": "${capture}.g.dart,${capture}.freezed.dart,${capture}.auto_mappr.dart"
29-
},
30-
"yaml.schemaStore.enable": false
2+
"dart.flutterSdkPath": ".fvm/versions/3.19.4",
3+
"search.exclude": {
4+
"**/.fvm": true,
5+
"**/*.g.dart": true
6+
},
7+
"files.exclude": {
8+
"**/.git": true,
9+
"**/.DS_Store": true,
10+
".idea/**": true,
11+
".run/**": true
12+
},
13+
"files.watcherExclude": {
14+
"**/.fvm": true
15+
},
16+
"dart.lineLength": 120,
17+
"editor.rulers": [
18+
120
19+
],
20+
"yaml.schemas": {
21+
"https://json.schemastore.org/dart-build.json": [
22+
"build.yaml"
23+
]
24+
},
25+
"explorer.fileNesting.enabled": true,
26+
"explorer.fileNesting.patterns": {
27+
"*.dart": "${capture}.g.dart,${capture}.freezed.dart,${capture}.auto_mappr.dart"
28+
},
29+
"yaml.schemaStore.enable": false
3130
}

packages/netglade_analysis/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 9.0.0
2+
- Adhere to DCM 1.15.0:
3+
- Add avoid-casting-to-extension-type
4+
- Add avoid-empty-spread
5+
- Add avoid-missing-completer-stack-trace
6+
- Add avoid-nested-extension-types
7+
- Add avoid-renaming-representation-getters
8+
- Add avoid-returning-void
9+
- Add avoid-slow-collection-methods
10+
- Add avoid-unknown-pragma
11+
- Add avoid-unnecessary-collections
12+
- Add prefer-overriding-parent-equality
13+
- Add prefer-private-extension-type-field
14+
- Add avoid-missing-controller
15+
- Add avoid-unnecessary-gesture-detector
16+
- Update prefer-correct-switch-length max-length to 20
17+
118
## 8.0.0
219
- Adhere to DCM 1.14.0:
320
- Add avoid-empty-test-groups

packages/netglade_analysis/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To use the lints, add as a dev dependency in your `pubspec.yaml`:
2323

2424
```yaml
2525
dev_dependencies:
26-
netglade_analysis: ^8.0.0
26+
netglade_analysis: ^9.0.0
2727
```
2828
2929
Then, add an include in `analysis_options.yaml`:

packages/netglade_analysis/lib/dcm.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# version 1.14.0 - https://dcm.dev/changelog/
1+
# version 1.15.0 - https://dcm.dev/changelog
22
dart_code_metrics:
33
rules:
44
### Common
@@ -14,6 +14,7 @@ dart_code_metrics:
1414
- avoid-bottom-type-in-patterns
1515
- avoid-bottom-type-in-records
1616
- avoid-cascade-after-if-null
17+
- avoid-casting-to-extension-type
1718
- avoid-collapsible-if
1819
- avoid-collection-methods-with-unrelated-types
1920
# - avoid-collection-mutating-methods # sometimes it's ok
@@ -31,6 +32,7 @@ dart_code_metrics:
3132
- avoid-duplicate-switch-case-conditions
3233
- avoid-duplicate-test-assertions
3334
- avoid-dynamic
35+
- avoid-empty-spread
3436
- avoid-empty-test-groups:
3537
include-methods:
3638
- blocTest
@@ -63,13 +65,15 @@ dart_code_metrics:
6365
- avoid-long-records
6466
- avoid-map-keys-contains
6567
- avoid-missed-calls
68+
- avoid-missing-completer-stack-trace
6669
- avoid-missing-enum-constant-in-map
6770
- avoid-misused-wildcard-pattern
6871
- avoid-mixing-named-and-positional-fields
6972
# - avoid-mutating-parameters # we use ValueNotifier etc.
7073
# - avoid-negated-conditions # sometimes it might be better
7174
- avoid-nested-conditional-expressions:
7275
acceptable-level: 2
76+
- avoid-nested-extension-types
7377
- avoid-nested-futures
7478
- avoid-nested-records
7579
- avoid-nested-streams-and-futures
@@ -99,6 +103,8 @@ dart_code_metrics:
99103
- avoid-redundant-positional-field-name
100104
- avoid-redundant-pragma-inline
101105
- avoid-referencing-discarded-variables
106+
- avoid-renaming-representation-getters
107+
- avoid-returning-void
102108
- avoid-self-assignment
103109
- avoid-self-compare
104110
- avoid-shadowed-extension-methods
@@ -107,6 +113,7 @@ dart_code_metrics:
107113
ignored-names:
108114
- context
109115
# - avoid-similar-names # way too pedantic
116+
- avoid-slow-collection-methods
110117
- avoid-substring
111118
- avoid-throw-in-catch-block
112119
- avoid-throw-objects-without-tostring
@@ -115,7 +122,9 @@ dart_code_metrics:
115122
- avoid-unassigned-stream-subscriptions
116123
- avoid-uncaught-future-errors
117124
- avoid-unconditional-break
125+
- avoid-unknown-pragma
118126
- avoid-unnecessary-call
127+
- avoid-unnecessary-collections
119128
- avoid-unnecessary-conditionals
120129
- avoid-unnecessary-futures
121130
# - avoid-unnecessary-getter # it's ok to have getter for private field
@@ -227,7 +236,8 @@ dart_code_metrics:
227236
# - prefer-correct-json-casts # overkill
228237
- prefer-correct-setter-parameter-name
229238
- prefer-correct-stream-return-type
230-
- prefer-correct-switch-length
239+
- prefer-correct-switch-length:
240+
max-length: 20 # default value 10 is sometimes way too much
231241
- prefer-correct-test-file-name
232242
- prefer-correct-type-name
233243
- prefer-declaring-const-constructor
@@ -251,8 +261,10 @@ dart_code_metrics:
251261
- prefer-named-boolean-parameters
252262
# - prefer-named-imports # * OK, we just don't have global config
253263
- prefer-null-aware-spread
264+
- prefer-overriding-parent-equality
254265
- prefer-parentheses-with-if-null
255266
# - prefer-prefixed-global-constants # * OK, we just don't have global config
267+
- prefer-private-extension-type-field
256268
- prefer-public-exception-classes
257269
- prefer-return-await
258270
# - prefer-returning-conditional-expressions # annoying sometimes
@@ -291,6 +303,7 @@ dart_code_metrics:
291303
- avoid-incomplete-copy-with
292304
- avoid-inherited-widget-in-initstate
293305
- avoid-late-context
306+
- avoid-missing-controller
294307
- avoid-missing-image-alt
295308
- avoid-recursive-widget-calls
296309
- avoid-returning-widgets
@@ -299,6 +312,7 @@ dart_code_metrics:
299312
- avoid-state-constructors
300313
- avoid-stateless-widget-initialized-fields
301314
- avoid-undisposed-instances
315+
- avoid-unnecessary-gesture-detector
302316
- avoid-unnecessary-overrides-in-state
303317
- avoid-unnecessary-setstate
304318
- avoid-unnecessary-stateful-widgets

packages/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: 8.0.0
2+
version: 9.0.0
33
description: Lint rules for Dart and Flutter used internally at netglade.
44
repository: https://github.com/netglade/flutter_core/tree/main/packages/netglade_analysis
55
issue_tracker: https://github.com/netglade/flutter_core/issues

0 commit comments

Comments
 (0)