Skip to content

Conversation

@gnclmorais
Copy link
Contributor

@gnclmorais gnclmorais commented Jan 31, 2026

I was reading an article about standardrb and realised we have Rubocop installed but we don’t use it a lot. I looked a bit more into it, added a few plugins, and I’m planning to bring overcommit into the project to trigger these checks automatically (happy to talk about this, we could do it differently, like through a GitHub action).

The second commit was Rubocop fixing the simple instances, so there are still many infringement but they are not safe replacements, so they’ll need human intervention (in other words, more to come).

Comment on lines -13 to 17
if workshop_sponsors.save
flash[:notice] = 'Sponsor added successfully'
flash[:notice] = if workshop_sponsors.save
'Sponsor added successfully'
else
flash[:notice] = workshop_sponsors.errors.full_messages.to_s
workshop_sponsors.errors.full_messages.to_s
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

A style I've been using, to get balanced if/else/end blocks, is:

foo =
  if true
    # code here
  else
    # and here
  end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it, if you feel strongly about it we can see if Rubocop supports its enforcement.

Copy link
Collaborator

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Nice, focused changes.

@olleolleolle olleolleolle merged commit bbb20a4 into codebar:master Feb 1, 2026
2 checks passed
@gnclmorais gnclmorais deleted the extend-rubocop branch February 1, 2026 12:03
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.

2 participants