Skip to content

Fix a false positive in missing_equatable_props - #558

Open
PiotrRogulski wants to merge 1 commit into
masterfrom
fix/equatable-props-lint-false-positive
Open

Fix a false positive in missing_equatable_props#558
PiotrRogulski wants to merge 1 commit into
masterfrom
fix/equatable-props-lint-false-positive

Conversation

@PiotrRogulski

Copy link
Copy Markdown
Member

missing_equatable_props asked for super.props whenever the superclass exposed a
concrete props getter, even when that getter returns an empty list. Referencing it
there contributes nothing to equality, so the warning was noise and the quick fix
inserted a no-op entry.

The analyzer can't reach a superclass's props body across libraries, so the check
now leans on the rule's own model of props — the list of a class's non-static
fields. A superclass chain that declares no such fields necessarily has an empty
props, so super.props is only required when some ancestor between the superclass
and Equatable declares a field of its own. Being element-based, this behaves the
same whether the parent lives in the same file or another package.

One deliberate false negative follows: a parent with no fields but a hand-written
props => [someGetter] no longer gets super.props suggested. That matches the rule
already never requiring getters in props.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the p: leancode_lint Related to the leancode_lint package label Aug 8, 2026
@PiotrRogulski
PiotrRogulski requested a review from Komoszek August 8, 2026 21:45
@PiotrRogulski
PiotrRogulski marked this pull request as ready for review August 8, 2026 21:45
@PiotrRogulski
PiotrRogulski requested a review from mchudy as a code owner August 8, 2026 21:45
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.

1 participant