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

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Fix standardrb violations #482

merged 1 commit into from
Nov 11, 2024

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 requested a review from smaboshe as a code owner July 19, 2024 14:22
@sarahraqueld sarahraqueld marked this pull request as draft July 19, 2024 14:22
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!

@sarahraqueld sarahraqueld force-pushed the fix-standardrb-violations branch from 06d75f7 to 5b39668 Compare October 31, 2024 12:21
@sarahraqueld sarahraqueld marked this pull request as ready for review October 31, 2024 12:21
@sarahraqueld sarahraqueld requested a review from smaboshe October 31, 2024 12:22
@sarahraqueld sarahraqueld merged commit d08be42 into main Nov 11, 2024
16 checks passed
@sarahraqueld sarahraqueld deleted the fix-standardrb-violations branch November 11, 2024 16:18
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