#rubocop

John Leachjohnl
2025-06-17

ACAB also applies to Rubocop

Andrei Kaleshkawidefix@ruby.social
2025-06-05

If you got #rubocop failing on EmptyInterpolation linter in the recent version (v1.76.0), there is good news for you. The issue got fixed - github.com/rubocop/rubocop/pul

#ruby

Bozhidar Batsov (a.k.a. Bug)bbatsov@hachyderm.io
2025-05-22

You might have noticed a record-breaking 7th consecutive bugfix release for #RuboCop (see github.com/rubocop/rubocop/rel). I just wanted to say that's not because the quality of RuboCop dropped, but because I've decided to focus on bug-fixing and polish for a while.

We have plenty of features already! 😁

#Ruby

Bozhidar Batsov (a.k.a. Bug)bbatsov@hachyderm.io
2025-04-22

#RuboCop celebrated its 13th birthday yesterday! It's amazing how far we've come along and how strong the project is going after all that time. A huge THANKS to everyone who was part of this amazing journey so far. As usual - the best is yet to come!

#Ruby

2025-02-27

I added a new configuration option to the `Naming/PredicateName` RuboCop rule: `UseSorbetSigs`. And it’s now released.

If set, it will take into account Sorbet sigs. So it will only complain if the method doesn’t start/end with the right things (like is_, has_, question mark) if there’s a `returns(T::Boolean)` sig.

Setting this option has reduced the number of TODOs for this rule in the `github/github` codebase by over 50%.

#Ruby #RuboCop #Sorbet

James Smith šŸ’¾floppy@mastodon.me.uk
2025-02-27

Just wrote my first custom #Rubocop extension to check that Pundit policy_scope is being used in all the right places in @manyfold. It's very very early stage code with no tests and in a complete mess, but it works! #Ruby #Rails

github.com/manyfold3d/rubocop-

2025-02-16

I have no idea why I'm getting these rubocop errors. Rubocop seems to think these constants are defined within a `private` section, but they are not. The classes do however include a small `private` section above which is terminated by another `public` keyword, which should not effect the constants below the `public` keyword. I cannot seem to reproduce this rubocop bug in a stand-alone example.
github.com/ronin-rb/ronin-vuln

#rubocop

Esparta :ruby:esparta@ruby.social
2025-02-11

@MoskitoHero there's a #ruby convention about that:

rubystyle.guide/#safe-because-

But I've seen them disabled on most #rubocop configurations I've seen so far.

There's also something similar in #reek:

github.com/sdurko/reek/blob/ma

Anyway, I do support that convention, but I lean more on not use them that often. I do prefer "safe" methods (functional style much) and I don't use it for side effect - it's implicit in their module names.

2025-01-26

Seriously considering launching myself as able to take on #freelance work on #Ruby, #RuboCop, #Sorbet, etc stuff.

There’s something very satisfying about fixing a list of things and making a codebase better in terms of consistency and developer experience. And I know a lot of people don’t enjoy that.

Very part-time. I love my ā€œrealā€ job and everything else I do (OSS, events). After my maths exam would make more sense. But I’m still bored at weekends and the winter electricity bills are šŸ“ˆšŸ˜©.

2025-01-10

A #Rubocop annoyance is that (last I checked) it doesn’t support my preferred formatting:

FactoryBot.create(:item,
foo: ā€œbarā€,
# Imagine more attributes here
)

You need either

FactoryBot.create(:item,
foo: ā€œbarā€ # <- sad lack of comma
)

or

FactoryBot.create(
:item,
foo: ā€œbarā€,
)

or

FactoryBot.create(:item, foo: ā€œbarā€)

I may need to add support for it sometime, if it’s not there and I missed it. Just me?

Bozhidar Batsov (a.k.a. Bug)bbatsov@hachyderm.io
2024-11-22

#Ruby's parser gem is nearly the end of the road github.com/whitequark/parser/i Moving fully away from it will present some challenges to projects like #RuboCop (mostly because Prism currently misses some of parser's features), but it seems inevitable at this point.

2024-11-18

I guess `Integer#allbits?` / `Integer#nobits?` optimizes better than `num & bitmask == result` since it's one method call vs. a bitwise operation and a comparison?
docs.rubocop.org/rubocop/cops_

#ruby #rubocop

2024-11-18

Also apparently Style/BitwisePredicate is marked as an unsafe cop. Is there a rubocop configuration setting to disable *all* unsafe cops so I don't have to play wake-a-mole with rubocop?

#rubocop

2024-11-18

Apparently rubocop is now recommending using Integer#allbits? / Integer#nobits? instead of `(num & 0xff) == 0xff`. I don't know how I feel about this... I feel like bitwise operations are more explicit.
docs.rubocop.org/rubocop/cops_

#ruby #rubocop

2024-11-17

Wondering if rubocop should be in a separate GitHub Actions YAML file that only runs when any .rb file is changed? This might cut down on unnecessary rubocop runs.
#rubocop

jm3 (John Manoogian III)jm3@ruby.social
2024-10-24

when #rubocop's ABC Size metric helps me refactor a method from ABC size of 35+ down to sub 17: Unbothered. Moisturized. Happy. In My Lane. Focused. #Flourishing.

Lucas M :ruby:lucasm@ruby.social
2024-10-23

I recently ran into an old codebase (~12 years old) without a Rubocop configuration, and figured adding one to existing code wasn't always as easy as it seems.

Here's a little step-by-step guide I wrote on how to tackle this kind of situation:
dev.to/lcsm0n/adding-a-rubocop

#ruby #rails #rubocop #opensource

Bozhidar Batsov (a.k.a. Bug)bbatsov@hachyderm.io
2024-10-15

The time has come for a gigantic RuboCop release, that's jam-packed with bug fixes and small improvements github.com/rubocop/rubocop/rel Enjoy!

#ruby #rubocop

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst