Skip to content

Fix standardrb violations#482

Merged
sarahraqueld merged 1 commit into
mainfrom
fix-standardrb-violations
Nov 11, 2024
Merged

Fix standardrb violations#482
sarahraqueld merged 1 commit into
mainfrom
fix-standardrb-violations

Conversation

@sarahraqueld
Copy link
Copy Markdown
Member

@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
Copy Markdown
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
Copy Markdown
Member Author

Yay! 🎉

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

@smaboshe
Copy link
Copy Markdown
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
@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