Skip to content

Commit

Permalink
Merge pull request #31 from netglade/feat/adhere-dcm-1.15.0
Browse files Browse the repository at this point in the history
Adhere to DCM 1.15.0
  • Loading branch information
tenhobi authored Mar 27, 2024
2 parents 5d94851 + 181a318 commit 142512a
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 36 deletions.
3 changes: 1 addition & 2 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"flutterSdkVersion": "3.19.0",
"flavors": {}
"flutterSdkVersion": "3.19.4"
}
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.19.4"
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ melos_my_project.iml
.vscode/*
!.vscode/tasks.json
!.vscode/settings.json
.fvm/flutter_sdk
.fvm/

.packages
.pub/
Expand Down
57 changes: 28 additions & 29 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
"search.exclude": {
"**/.fvm": true,
"**/*.g.dart": true,
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
".idea/**": true,
".run/**": true,
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
},
"dart.lineLength": 120,
"editor.rulers": [
120
],
"yaml.schemas": {
"https://json.schemastore.org/dart-build.json": [
"build.yaml"
]
},
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*.dart": "${capture}.g.dart,${capture}.freezed.dart,${capture}.auto_mappr.dart"
},
"yaml.schemaStore.enable": false
"dart.flutterSdkPath": ".fvm/versions/3.19.4",
"search.exclude": {
"**/.fvm": true,
"**/*.g.dart": true
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
".idea/**": true,
".run/**": true
},
"files.watcherExclude": {
"**/.fvm": true
},
"dart.lineLength": 120,
"editor.rulers": [
120
],
"yaml.schemas": {
"https://json.schemastore.org/dart-build.json": [
"build.yaml"
]
},
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*.dart": "${capture}.g.dart,${capture}.freezed.dart,${capture}.auto_mappr.dart"
},
"yaml.schemaStore.enable": false
}
17 changes: 17 additions & 0 deletions packages/netglade_analysis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 9.0.0
- Adhere to DCM 1.15.0:
- Add avoid-casting-to-extension-type
- Add avoid-empty-spread
- Add avoid-missing-completer-stack-trace
- Add avoid-nested-extension-types
- Add avoid-renaming-representation-getters
- Add avoid-returning-void
- Add avoid-slow-collection-methods
- Add avoid-unknown-pragma
- Add avoid-unnecessary-collections
- Add prefer-overriding-parent-equality
- Add prefer-private-extension-type-field
- Add avoid-missing-controller
- Add avoid-unnecessary-gesture-detector
- Update prefer-correct-switch-length max-length to 20

## 8.0.0
- Adhere to DCM 1.14.0:
- Add avoid-empty-test-groups
Expand Down
2 changes: 1 addition & 1 deletion packages/netglade_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To use the lints, add as a dev dependency in your `pubspec.yaml`:

```yaml
dev_dependencies:
netglade_analysis: ^8.0.0
netglade_analysis: ^9.0.0
```
Then, add an include in `analysis_options.yaml`:
Expand Down
18 changes: 16 additions & 2 deletions packages/netglade_analysis/lib/dcm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# version 1.14.0 - https://dcm.dev/changelog/
# version 1.15.0 - https://dcm.dev/changelog
dart_code_metrics:
rules:
### Common
Expand All @@ -14,6 +14,7 @@ dart_code_metrics:
- avoid-bottom-type-in-patterns
- avoid-bottom-type-in-records
- avoid-cascade-after-if-null
- avoid-casting-to-extension-type
- avoid-collapsible-if
- avoid-collection-methods-with-unrelated-types
# - avoid-collection-mutating-methods # sometimes it's ok
Expand All @@ -31,6 +32,7 @@ dart_code_metrics:
- avoid-duplicate-switch-case-conditions
- avoid-duplicate-test-assertions
- avoid-dynamic
- avoid-empty-spread
- avoid-empty-test-groups:
include-methods:
- blocTest
Expand Down Expand Up @@ -63,13 +65,15 @@ dart_code_metrics:
- avoid-long-records
- avoid-map-keys-contains
- avoid-missed-calls
- avoid-missing-completer-stack-trace
- avoid-missing-enum-constant-in-map
- avoid-misused-wildcard-pattern
- avoid-mixing-named-and-positional-fields
# - avoid-mutating-parameters # we use ValueNotifier etc.
# - avoid-negated-conditions # sometimes it might be better
- avoid-nested-conditional-expressions:
acceptable-level: 2
- avoid-nested-extension-types
- avoid-nested-futures
- avoid-nested-records
- avoid-nested-streams-and-futures
Expand Down Expand Up @@ -99,6 +103,8 @@ dart_code_metrics:
- avoid-redundant-positional-field-name
- avoid-redundant-pragma-inline
- avoid-referencing-discarded-variables
- avoid-renaming-representation-getters
- avoid-returning-void
- avoid-self-assignment
- avoid-self-compare
- avoid-shadowed-extension-methods
Expand All @@ -107,6 +113,7 @@ dart_code_metrics:
ignored-names:
- context
# - avoid-similar-names # way too pedantic
- avoid-slow-collection-methods
- avoid-substring
- avoid-throw-in-catch-block
- avoid-throw-objects-without-tostring
Expand All @@ -115,7 +122,9 @@ dart_code_metrics:
- avoid-unassigned-stream-subscriptions
- avoid-uncaught-future-errors
- avoid-unconditional-break
- avoid-unknown-pragma
- avoid-unnecessary-call
- avoid-unnecessary-collections
- avoid-unnecessary-conditionals
- avoid-unnecessary-futures
# - avoid-unnecessary-getter # it's ok to have getter for private field
Expand Down Expand Up @@ -227,7 +236,8 @@ dart_code_metrics:
# - prefer-correct-json-casts # overkill
- prefer-correct-setter-parameter-name
- prefer-correct-stream-return-type
- prefer-correct-switch-length
- prefer-correct-switch-length:
max-length: 20 # default value 10 is sometimes way too much
- prefer-correct-test-file-name
- prefer-correct-type-name
- prefer-declaring-const-constructor
Expand All @@ -251,8 +261,10 @@ dart_code_metrics:
- prefer-named-boolean-parameters
# - prefer-named-imports # * OK, we just don't have global config
- prefer-null-aware-spread
- prefer-overriding-parent-equality
- prefer-parentheses-with-if-null
# - prefer-prefixed-global-constants # * OK, we just don't have global config
- prefer-private-extension-type-field
- prefer-public-exception-classes
- prefer-return-await
# - prefer-returning-conditional-expressions # annoying sometimes
Expand Down Expand Up @@ -291,6 +303,7 @@ dart_code_metrics:
- avoid-incomplete-copy-with
- avoid-inherited-widget-in-initstate
- avoid-late-context
- avoid-missing-controller
- avoid-missing-image-alt
- avoid-recursive-widget-calls
- avoid-returning-widgets
Expand All @@ -299,6 +312,7 @@ dart_code_metrics:
- avoid-state-constructors
- avoid-stateless-widget-initialized-fields
- avoid-undisposed-instances
- avoid-unnecessary-gesture-detector
- avoid-unnecessary-overrides-in-state
- avoid-unnecessary-setstate
- avoid-unnecessary-stateful-widgets
Expand Down
2 changes: 1 addition & 1 deletion packages/netglade_analysis/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: netglade_analysis
version: 8.0.0
version: 9.0.0
description: Lint rules for Dart and Flutter used internally at netglade.
repository: https://github.com/netglade/flutter_core/tree/main/packages/netglade_analysis
issue_tracker: https://github.com/netglade/flutter_core/issues
Expand Down

0 comments on commit 142512a

Please sign in to comment.