Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint): useless assign with method call within a condition #485

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

veelenga
Copy link
Member

fixes #468

@veelenga veelenga requested a review from Sija October 14, 2024 09:33
@veelenga veelenga self-assigned this Oct 14, 2024
@@ -181,6 +181,8 @@ module Ameba::AST
if loop?(node) && (block = node.block)
on_branchable_start node, block.body
end

true
Copy link
Member Author

@veelenga veelenga Oct 14, 2024

Choose a reason for hiding this comment

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

A visitor class that constructs branches ignored all the nodes inside Crystal::Call

spec/ameba/rule/lint/useless_assign_spec.cr Outdated Show resolved Hide resolved
@Sija Sija added this to the 1.6.3 milestone Oct 14, 2024
@Sija Sija enabled auto-merge October 14, 2024 12:32
@Sija Sija merged commit 1d34b07 into master Oct 14, 2024
4 checks passed
@Sija Sija deleted the fix/call-within-branch branch October 14, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive Lint/UselessAssign
2 participants