Skip to content

Fix false positive in prefer-equals-comparison#1828

Merged
charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom
anderseknert:fix-prefer-equals-fp
Jan 13, 2026
Merged

Fix false positive in prefer-equals-comparison#1828
charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom
anderseknert:fix-prefer-equals-fp

Conversation

@anderseknert
Copy link
Member

We'd previously fail to account for comprehension term vars in this rule. I'm pretty sure the logic here needs to extend into other locations in Regal, but this at least fixes the immediate issue as reported.

Fixes #1826

@charlieegan3 charlieegan3 changed the title Fix false positivie in prefer-equals-comparison Fix false positive in prefer-equals-comparison Jan 13, 2026
We'd previously fail to account for comprehension term vars in this rule.
I'm pretty sure the logic here needs to extend into other locations in Regal,
but this at least fixes the immediate issue as reported.

Fixes open-policy-agent#1826

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
@charlieegan3 charlieegan3 enabled auto-merge (squash) January 13, 2026 11:11
@charlieegan3 charlieegan3 merged commit e68184d into open-policy-agent:main Jan 13, 2026
8 checks passed
@anderseknert anderseknert deleted the fix-prefer-equals-fp branch January 13, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive identified for prefer-equals-comparison rule

2 participants