Revived extension to autoformat with Rubocop in VSCode

lorankloeze

Loran Kloeze

Posted on July 29, 2022

Revived extension to autoformat with Rubocop in VSCode

There is a nice VSCode extension called vscode-ruby-rubocop that you can use to automatically format a Ruby file using Format document (Shift+Alt+F). Unfortunately, that extension seems to be unmaintained for over 6 months now... ๐Ÿ˜ข

But there is some good news. ๐ŸŽ‰๐ŸŽ‰ I have forked the repository and fixed a few things:

  • Changed the Rubocop argument --auto-correct to --autocorrect because --auto-correct is deprecated.
  • Added configuration option ruby.rubocop.useServer. When you enable this option, Rubocop is started with --server which dramatically increases formatting speed. Keep in mind, this option only works with Rubocop >= 1.31.

You can find the revived extension at GitHub and in the VSCode marketplace.

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
lorankloeze
Loran Kloeze

Posted on July 29, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

ยฉ TheLazy.dev

About