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.
From the terminal:
$ gem install rubocop
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
Install SublimeLinter3
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
Install SublimeLinter-rubocop
Within Sublime:
- Open the command palette with
shift + command + P - Type
package install - Type
SublimeLinter-rubocop
For a less intrusive linting experience, change the lint mode to load/save and lint style to squiggly underline.
Tools => SublmeLinter => Lint Mode => Load/saveTools => SublmeLinter => Mark Style => Squiggly underline