Skip to content

Commit

Permalink
Merge pull request #16 from netglade/feat/7.0.0
Browse files Browse the repository at this point in the history
Version 7.0.0
  • Loading branch information
tenhobi authored Jan 11, 2024
2 parents 4c6c7b8 + 962f772 commit 75bce97
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 7.0.0
- Adhere to DCM 1.13.0:
- Add avoid-duplicate-collection-elements
- Add avoid-duplicate-initializers
- Add avoid-duplicate-map-keys
- Add avoid-nullable-tostring
- Add avoid-unused-after-null-check
- Add move-variable-outside-iteration
- Add avoid-undisposed-instances
- Add avoid-unassigned-stream-subscriptions
- Update prefer-switch-with-enums with `ignore-contains: true`
- 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)

## 6.0.0
- Add DCM rule prefer-correct-error-name with `e` for error
- Add DCM rule prefer-widget-private-members
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 0.0.1
publish_to: none

environment:
sdk: ">=2.18.0 <3.0.0"
sdk: ">=2.18.0 <4.0.0"

dependencies:
netglade_analysis:
Expand Down
23 changes: 16 additions & 7 deletions lib/dcm.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# version 1.12.0 - https://dcm.dev/changelog/
# version 1.13.0 - https://dcm.dev/changelog/
dart_code_metrics:
rules:
### Common
Expand All @@ -20,7 +20,10 @@ dart_code_metrics:
- avoid-declaring-call-method
- avoid-double-slash-imports
- avoid-duplicate-cascades
- avoid-duplicate-collection-elements
- avoid-duplicate-exports
- avoid-duplicate-initializers
- avoid-duplicate-map-keys
- avoid-duplicate-mixins
- avoid-duplicate-named-imports
- avoid-duplicate-patterns
Expand Down Expand Up @@ -75,6 +78,7 @@ dart_code_metrics:
- test/**
- avoid-nullable-interpolation
- avoid-nullable-parameters-with-default-values
- avoid-nullable-tostring
- avoid-one-field-records
- avoid-passing-async-when-sync-expected:
exclude:
Expand All @@ -101,6 +105,7 @@ dart_code_metrics:
- avoid-throw-objects-without-tostring
- avoid-top-level-members-in-tests
- avoid-unassigned-late-fields
- avoid-unassigned-stream-subscriptions
- avoid-uncaught-future-errors
- avoid-unconditional-break
- avoid-unnecessary-call
Expand All @@ -119,6 +124,7 @@ dart_code_metrics:
- avoid-unrelated-type-assertions
- avoid-unrelated-type-casts
- avoid-unsafe-collection-methods
- avoid-unused-after-null-check
- avoid-unused-generics
- avoid-unused-instances
- avoid-unused-parameters
Expand All @@ -137,7 +143,7 @@ dart_code_metrics:
- map-keys-ordering:
exclude:
- test/**
- match-class-name-pattern
# - match-class-name-pattern # * OK, we just don't have global config
# - match-getter-setter-field-names # forces API to equals internal code
# - match-lib-folder-structure # maybe later
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
Expand Down Expand Up @@ -170,6 +176,7 @@ dart_code_metrics:
min-fields: 3
min-occurrences: 3
- move-variable-closer-to-its-usage
- move-variable-outside-iteration
- newline-before-case
- newline-before-return
- no-boolean-literal-compare:
Expand Down Expand Up @@ -238,7 +245,7 @@ dart_code_metrics:
# - prefer-named-imports # * OK, we just don't have global config
- prefer-null-aware-spread
- prefer-parentheses-with-if-null
# - prefer-prefixed-global-constants # * OK, we just don't have global config
# - prefer-prefixed-global-constants # * OK, we just don't have global config
- prefer-public-exception-classes
- prefer-return-await
# - prefer-returning-conditional-expressions # annoying sometimes
Expand All @@ -249,7 +256,8 @@ dart_code_metrics:
ignore-names:
- (.*)Provider
- use(.*)
- prefer-switch-with-enums
- prefer-switch-with-enums:
ignore-contains: true
- prefer-test-matchers
- prefer-trailing-comma
# - prefer-type-over-var # we prefer type inference
Expand All @@ -263,12 +271,12 @@ dart_code_metrics:
# - avoid-missing-test-files # * OK, but should be enabled per project
- avoid-misused-test-matchers
- prefer-wildcard-pattern
- tag-name
# - tag-name # * OK, we just don't have global config
- unnecessary-trailing-comma:
max-width: 80

### Flutter
- add-copy-with
# - add-copy-with # * OK, we just don't have global config
- always-remove-listener
- avoid-border-all
- avoid-empty-setstate
Expand All @@ -283,6 +291,7 @@ dart_code_metrics:
- avoid-single-child-column-or-row
- avoid-state-constructors
- avoid-stateless-widget-initialized-fields
- avoid-undisposed-instances
- avoid-unnecessary-overrides-in-state
- avoid-unnecessary-setstate
- avoid-unnecessary-stateful-widgets
Expand Down Expand Up @@ -321,7 +330,7 @@ dart_code_metrics:
- prefer-multi-bloc-provider

### Equatable
- extend-equatable
# - extend-equatable # * OK, we just don't have global config
- list-all-equatable-fields

### Flame - not used
Expand Down
2 changes: 2 additions & 0 deletions lib/netglade_analysis.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: unused-files

/// NetGlade Dart and Flutter analyzer settings and best practices
/// used internally at [netglade](https://netglade.com).
library netglade_analysis;
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: netglade_analysis
version: 6.0.0
version: 7.0.0
description: Lint rules for Dart and Flutter used internally at netglade.
repository: https://github.com/netglade/netglade_analysis
issue_tracker: https://github.com/netglade/netglade_analysis/issues
Expand Down

0 comments on commit 75bce97

Please sign in to comment.