Skip to content

Update prefer_equatable_mixin for equatable 2.1.0 - #542

Open
PiotrRogulski wants to merge 2 commits into
masterfrom
new-equatable-behavior-lint
Open

Update prefer_equatable_mixin for equatable 2.1.0#542
PiotrRogulski wants to merge 2 commits into
masterfrom
new-equatable-behavior-lint

Conversation

@PiotrRogulski

Copy link
Copy Markdown
Member

No description provided.

@PiotrRogulski
PiotrRogulski requested a review from Copilot July 5, 2026 17:50
@PiotrRogulski
PiotrRogulski requested a review from mchudy as a code owner July 5, 2026 17:50
@github-actions github-actions Bot added the p: leancode_lint Related to the leancode_lint package label Jul 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mixin diagnostic text + auto-fix to recommend Equatable vs EquatableMixin based on whether Equatable is a mixin class.
  • Expand tests and mocks to cover both equatable >= 2.1.0 and < 2.1.0 behavior; update missing_equatable_props tests to use with 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: leancode_lint Related to the leancode_lint package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants