Skip to content

pmenglund/rstyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Source code style checker for Ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages