Skip to content

Instantly share code, notes, and snippets.

@getaclue00
Created May 16, 2018 01:48
Show Gist options
  • Select an option

  • Save getaclue00/edbf6e65c386afd361ebeace7323d0ef to your computer and use it in GitHub Desktop.

Select an option

Save getaclue00/edbf6e65c386afd361ebeace7323d0ef to your computer and use it in GitHub Desktop.
Rubocop linter within Sublime Text 3

Rubocop Linter with Sublime Text 3

Rubocop is a static code analyzer based on the community driven Ruby style guide. The following steps set up Rubocop as a linter within Sublime Text 3.

Install Rubocop

From the terminal:

$ gem install rubocop

Install Sublime Text Package Control

This is accomplished through the Sublime Text console.

  • Within Sublime Text, open the console via ctrl + ~. It will appear at the bottom of the window
  • Copy the install code from the package control installation page. Ensure the Sublime Text 3 tab is copied
  • Paste this code into the sublime console

This is installed through Sublime's package control, and is the framework that must be in place before installing each individual linter.

Within Sublime:

  • Open the command palette with shift + command + P
  • Type package install
  • Type SublimeLinter. Choose the Sublime Text 3 version

Within Sublime:

  • Open the command palette with shift + command + P
  • Type package install
  • Type SublimeLinter-rubocop

Recommendations

For a less intrusive linting experience, change the lint mode to load/save and lint style to squiggly underline.

  • Tools => SublmeLinter => Lint Mode => Load/save
  • Tools => SublmeLinter => Mark Style => Squiggly underline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment