Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Source code style checker for Ruby
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
spec
.gitignore
.rspec
.rstyle
.travis.yml
Gemfile
LICENSE
README.textile
Rakefile
rstyle.gemspec

README.textile

RStyle

Implements checks for some of the Ruby style guide items.

This tool is meant to be use as a pre-commit hook for git, to ensure the code is properly formatted. Run the following

cd .git/hooks
ln -s /path/to/bin/rstyle

and you’ll have to be compliant with the rstyle checks to be able to commit code to the repository.

It can also be used to check one or more ruby files in standalone mode:

rstyle /path/to/rubyfile.rb

Style checks

The style checker looks for the following:

  • line longer than 80 characters
  • empty line contains whitespace
  • line contains tab(s)
  • line ends with whitespace
  • no space after ,
  • space after ( and [ or before ) and ]
  • methods should be in snake_case
  • use two spaces before statement modifiers

It will also issue warnings for the following:

  • don’t use for/code> unless you know what you are doing
Something went wrong with that request. Please try again.