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

AnyInsteadOfEmpty rule uses wrong node position #267

Closed
jwoertink opened this issue Apr 21, 2022 · 1 comment · Fixed by #268
Closed

AnyInsteadOfEmpty rule uses wrong node position #267

jwoertink opened this issue Apr 21, 2022 · 1 comment · Fixed by #268
Assignees
Labels
Milestone

Comments

@jwoertink
Copy link

In Lucky, we have a query method .any?. This actually runs SQL, so Performance/AnyInsteadOfEmpty rule here doesn't apply.

This code passed on 0.14.4, but fails on 1.0.0

TransactionQuery.new
  .receiver(user)
  .any? # ameba:disable Performance/AnyInsteadOfEmpty
src/serializers/post_serializer.cr:80:24 [Correctable]
[C] Performance/AnyInsteadOfEmpty: Use `!{...}.empty?` instead of `{...}.any?`
> TransactionQuery.new
  ^

Maybe solved by #265 ?

@Sija Sija added the bug label Apr 21, 2022
@Sija
Copy link
Member

Sija commented Apr 21, 2022

That's a regression, and shouldn't depend on #265 in any way.

@Sija Sija changed the title "Correctable" issues don't account for disabled rules AnyInsteadOfEmpty rule uses wrong node position Apr 21, 2022
@Sija Sija self-assigned this Apr 21, 2022
@Sija Sija closed this as completed in #268 Apr 22, 2022
@Sija Sija added this to the 1.0.1 milestone Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants