Update prefer_equatable_mixin for equatable 2.1.0 - #542
Open
PiotrRogulski wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates leancode_lint’s prefer_equatable_mixin rule to reflect equatable >= 2.1.0, where Equatable can be mixed in directly (and EquatableMixin is deprecated), while preserving correct behavior for older equatable versions via version-sensitive detection in the analyzer model.
Changes:
- Update
prefer_equatable_mixindiagnostic text + auto-fix to recommendEquatablevsEquatableMixinbased on whetherEquatableis amixin class. - Expand tests and mocks to cover both
equatable>= 2.1.0 and < 2.1.0 behavior; updatemissing_equatable_propstests to usewith Equatable. - Update README + changelog and bump package version to
24.1.0.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/leancode_lint/lib/src/lints/prefer_equatable_mixin.dart | Makes the recommendation/fix conditional on whether Equatable is a mixin class (new equatable behavior). |
| packages/leancode_lint/test/test_cases/prefer_equatable_mixin_test.dart | Adds coverage for both new and old equatable semantics and validates the updated messaging. |
| packages/leancode_lint/test/mock_libraries/equatable.dart | Introduces separate mocks for equatable >= 2.1.0 and < 2.1.0 to drive version-specific tests. |
| packages/leancode_lint/test/assert_ranges.dart | Extends range-based assertions to optionally validate diagnostic message contents per range. |
| packages/leancode_lint/test/test_cases/missing_equatable_props_test.dart | Updates test inputs to use with Equatable (new preferred mixin form) while keeping deprecated mixin coverage. |
| packages/leancode_lint/lib/src/lints/missing_equatable_props.dart | Updates documentation comment to reflect both Equatable and EquatableMixin mixin usage. |
| packages/leancode_lint/README.md | Updates rule documentation and examples for equatable >= 2.1.0, including fallback behavior notes. |
| packages/leancode_lint/pubspec.yaml | Bumps package version to 24.1.0. |
| packages/leancode_lint/CHANGELOG.md | Adds release notes for the updated lint behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.