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 standardrb violations #482

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

sarahraqueld
Copy link
Contributor

@sarahraqueld sarahraqueld commented Jul 19, 2024

Fixes #474

Problem

Standard is failing:

spec/support/macros/define_constant.rb:10:40: Style/ArgumentsForwarding: Use anonymous block arguments forwarding (&).
spec/support/macros/define_constant.rb:11:52: Style/ArgumentsForwarding: Use anonymous block arguments forwarding (&).
spec/support/macros/define_constant.rb:20:32: Style/ArgumentsForwarding: Use anonymous block arguments forwarding (&).
spec/support/macros/define_constant.rb:25:43: Style/ArgumentsForwarding: Use anonymous block arguments forwarding (&).

Running standardrb --fix changes &block to &, however, this only works for ruby >= 3.2.

Since we still support Ruby 3.0, this change introduces these errors:

SyntaxError:

  /home/runner/work/factory_bot_rails/factory_bot_rails/spec/support/macros/define_constant.rb:10: syntax error, unexpected ')', expecting local variable or method
  ...ne_model(name, columns = {}, &)
  ...                              ^

@sarahraqueld sarahraqueld marked this pull request as draft July 19, 2024 14:22
@sarahraqueld
Copy link
Contributor Author

Ideas on how to fix this:

Remove support for Ruby 3.0
Find a way to make Standard support both versions (& and &block)

Copy link
Contributor

@smaboshe smaboshe left a comment

Choose a reason for hiding this comment

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

Yay! 🎉

@sarahraqueld
Copy link
Contributor Author

Yay! 🎉

oops, you approved the wrong PR, I think you meant to approve this one #489 :D

@smaboshe
Copy link
Contributor

smaboshe commented Sep 2, 2024

Yay! 🎉

oops, you approved the wrong PR, I think you meant to approve this one #489 :D

Oops! 😅 ... Thank you for taking care of this!

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.

Fix standard errors
2 participants