Recently our team started using Rubocop to maintain code styling. Most of us currently use Atom because it is a tremendously beautiful and versatile text editor. Out of the box, Rubocop is a command line tool. This works fine, but it's nice to get instant feedback as your are editing your code in Atom.
Enter the world of linter + linter-rubocop; two Atom plugins that automatically inspect your code in real time for any problems defined in your Rubocop files. Installing them is dead simple: 1. In your terminal, runapm install linter
(if not already installed). 2. Run
apm install linter-rubocop
. This automatically uses the default Rubocop configuration. That's fine, but what if your team already has a rubocop.yml file you want to use? No problem. In Atom, go to the package settings for linter-rubocop. Scroll down to settings. Enter something like this:
--config /Users/aualdrich/rubocop.yml
to tell Rubocop to use the settings our team likes. You can set this to whatever file you already use. Now, there are a couple of additional settings you'll probably want to configure for the linter. Here's a screenshot of what mine look like: