r/ruby • u/amatchmadeinregex • Jul 10 '26
git commit -m "appease the rubocop again"
Last day before PTO, no cards on the board and not really looking to start anything, so behold, I made a couple of memes of things that amuse me. Full disclosure, I complain about RuboCop but I *am* glad my team enforces it.
And of course, I can always update my RubyMine autoformat conventions to match but I forget to actually *do* it a lot. Bonus points when I 'fix' the rubocop violation, ⌘+Alt+L format because muscle memory, commit and push, and get the same rubocop violation...
159
Upvotes


27
u/keyslemur Jul 10 '26
Having seen engineers bikeshed about style on every single PR at a few past companies Rubocop or standardrb or rubyfmt are now effective requirements for any decently sized org. Not because ruby's flexibility is wrong, but because there are much more important things to argue about and solve than what particular quoting or indentation patterns someone prefers.
Phrased another way I've seen teams burn weeks on lint and style arguments when their SLOs for customers were redlining. Priorities are important and linters remove a contentious distraction early and effectively.
51
u/armahillo Jul 10 '26
Ive been on teams without a style linter like rubocop or stdrb; it either feels like walking in a mirror maze where you only find out you were “wrong” during review, or theres just no consensus and everyone disagrees constantly.
With rubocop, those feelings are still there but we all get to be mad at the robot together. Happier teams overall.
9
u/h0rst_ Jul 11 '26
I recently bumped into a bug where code threw a NoMethodError. The original code was like this:
if res == 0
But Rubocop told us that it had to be written this way:
But of course, there was a possibility that the result was
nil, so thank you for that bug.8
u/Weird_Suggestion Jul 10 '26
We use to have rubocop defaults and that was a nightmare. We disabled pretty much all of the rules only leaving what the team felt essential.
6
u/Best_Recover3367 Jul 10 '26
Me using Standardrb for everything: 💀
6
u/bhaak Jul 11 '26
Rubocop's default settings just suck. Whoever sets the default of those rules has no sense of aesthetics for Ruby code.
At least standardrb is better in that regard.
1
u/amatchmadeinregex Jul 11 '26
I was not expecting all the comments pointing out "rubocop -A" like they're Khaby Lame or something.
I do use rubocop -A from time to time (when it's feasible to do so), but the joke was more about Rubocop slapping my hand in the first place about formatting things the way I would prefer them. 😅
4
u/NoEntrepreneur39 Jul 11 '26
Rubocop: not on my watch
Me: git commit -m “Law abiding citizen”
7
u/6stringfanatic Jul 11 '26
Rubocop is a godsend actually, especially when so much code is being written by llms and agents. I've been using it to create rules, because agents will ignore conventions etc whenever they fancy, so rubocop just makes them agents stay in their lanes. Also a lot information/conventions would stay implicit across team members and folks would kinda follow, but now for agents its like every new session is a new hire, so codifying conventions has huge benefits imo.
2
u/temabolshakov Jul 14 '26
You know you can configure rubymine to follow rubycop/standardrb rules with one checkbox?
3
u/polysaturate Jul 11 '26
Has no one here run it with autocorrect? Write code, `bin/rubocop -A` and commit. Easy peasy
2
u/sshaw_ Jul 10 '26
Rubocop: the biggest killer of developer productivity I've ever seen!
1
u/mattvanhorn Jul 13 '26
ACAB includes Rubocop
-9
u/Correct_Support_2444 Jul 10 '26
I format my ruby the way I like it and that’s the way it is. If my devs don’t like it they can go work elsewhere. I’ve been doing it the same way for basically 20 years and I’m not changing. Oh and => are the way. Yes. Get off my lawn.