Title: Code and style checks for Ruby at Sublime Text
Slug: Code-and-style-checks-for-Ruby-at-Sublime-Text
Date: 2015-09-19 11:27:12
Author: Kartones
Lang: en
Tags: Tools, Development, Ruby
Description: Using Sublime Text for Ruby code and style checks, and setting up some Sublime plugins.

 <p>I use lately <a href="http://www.sublimetext.com/3">Sublime Text</a> a lot, both at work and at home, where it's curious that even for languages that I have better tools available and installed (C#/ASP.NET, Powershell...) I usually use Sublime too instead (because is faster and I don't need to compile nor debug). Also, at work my colleages have activated <a href="https://houndci.com/">Hound</a> to get GitHub comment <strike>floodings</strike> coding style violations and, as you get one comment per broken rule, some pull requests become really hard to code review.</p> <p>So, in order to prevent hound bites (and learn in a more confortable way what rules I should follow), I checked and fought a bit with Sublime plugins to setup the same rules that Hound uses for Ruby code (<a href="https://github.com/bbatsov/rubocop">Rubocop</a> gem) and have them inside my IDE. If you want to have realtime coding style checks inside Sublime 3, you need this:</p> <ul> <li><a href="https://packagecontrol.io/installation">Package Control</a>: Basic for the editor itself, but just in case. THE "plugin" manager  <li><a href="http://sublimelinter.readthedocs.org/en/latest/">SublimeLinter 3</a>: Generic text linter for the editor  <li><a href="https://github.com/SublimeLinter/SublimeLinter-rubocop">SublimeLinter-Rubocop</a>: The glue between Rubocop and SublimeLinter 3.</li></ul> <p>Just take into account to leave the Rubocop rules file named as <font face="Courier New">.rubocop.yml</font> at the project's base folder, because SublimeLinter-Rubocop doesn't allows to specify another name/path. Also restart the IDE after installing everything.</p> <p> </p> <p>It is fun that <a href="https://blog.kartones.net/post/mini-list-of-continuous-integration-tools">at 2005 we had nice aggregated CI reports</a> that you could also concatenate and send via a single email (or check online at your CI server) but at 2015 receiving literally 50 emails after creating a pull request seems good by a continuous integration tool maker... ¯\_(ツ)_/¯</p>
