Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A RubyGem that allows for checking standard styling of Ruby files.
Ruby
branch: master

This branch is 1 commit ahead, 788 commits behind turboladen:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
features
lib
spec
tasks
.gemtest
.gitignore
.infinity_test
.rspec
ChangeLog.rdoc
Gemfile
Gemfile.lock
README.rdoc
Rakefile
tailor.gemspec

README.rdoc

tailor

DESCRIPTION:

tailor recursively parses Ruby files in a directory and checks them for bad style. Rules for judging style are based on a number of style guides that are popular in the Ruby community. More on this here wiki.github.com/turboladen/tailor.

FEATURES/PROBLEMS:

  • Checks for bad style in .rb and .erb files

    • Recursively in a directory, or…

    • A given file

  • Checks for:

    • Indentation

      • Hard-tabs in indentation

    • Name cases

      • Snake case class & module names

      • Camel case method names

    • Extra whitespace

      • At the end of lines

      • On empty lines

      • Around commas

      • Around open/closed parentheses

      • Around open/closed square brackets

      • Around open/closed curly braces

      • Around colons in ternary statements

    • Line length

      • Should be <= 80 characters

SYNOPSIS:

Run tailor like:

$ tailor path/to/check/

…or…

$ tail file_to_check.rb

There are a number of false-positives and false-negatives in detection of the above rules, so please don't expect perfection in this detection. :) I'm working on solving this.

REQUIREMENTS:

  • Rubies (tested)

  • 1.8.7

  • 1.9.2

  • 1.9.3-preview1

  • Gems

    • term-ansicolor

INSTALL:

$ (sudo) gem install tailor

LICENSE:

(The MIT License)

Copyright © 2010-2011 Steve Loveless

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.