Project

rstyle

0.0
No commit activity in last 3 years
No release in over 3 years
Style checking for Ruby code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

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