Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to use Omakase Rubocop Linter/Formatter Rules for Rails Discussion

What do you think about having a built-in linter that comes with Rails?

Reply

If I'm honest after 20 years of Rails it feels a bit like "too little too late". Standard RB has been around for years so I'm not sure what another set of defaults really helps with apart from the obvious - new rails apps. There's a ton of apps in production that I can see wasting time setting this up and wrestling with issues with their old Rubocop rules. Reading this back it sounds really rather harsh... but fair...? Would love to know how you disagree...

Reply

Generally people run bin/rubocop command before committing the code or use git commit hooks to do so?

Reply

It's easily integrated with your editor so it warns already while writing the codes and can autofix most of if on save.

Reply

Usually, I used the auto formatter feature from Ruby Solargraph extension on VS Code and it will automatically read the rubocop.yml config and format the code based on that file.
And I also combine it with auto-format on save feature of VS Code.
It's more simple I think

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.