Add tailor ruby style check

Partial fix for bug 1185536

Change-Id: Ie3088d48047d107a55c81598d8f8e4260e5858d2
This commit is contained in:
sean 2013-06-10 14:49:59 -07:00
parent 61a42e80d5
commit 5cc19cee1c
4 changed files with 37 additions and 0 deletions

25
.tailor Normal file
View File

@ -0,0 +1,25 @@
Tailor.config do |config|
config.formatters "text"
config.file_set '**/*.rb' do |style|
style.max_line_length 80, level: :off
style.allow_camel_case_methods false, level: :error
style.allow_hard_tabs false, level: :error
style.allow_screaming_snake_case_classes false, level: :error
style.allow_trailing_line_spaces false, level: :error
style.allow_invalid_ruby false, level: :warn
style.indentation_spaces 2, level: :error
style.max_code_lines_in_class 300, level: :error
style.max_code_lines_in_method 30, level: :error
style.spaces_after_comma 1, level: :error
style.spaces_after_lbrace 1, level: :error
style.spaces_after_lbracket 0, level: :error
style.spaces_after_lparen 0, level: :error
style.spaces_before_comma 0, level: :error
style.spaces_before_lbrace 1, level: :error
style.spaces_before_rbrace 1, level: :error
style.spaces_before_rbracket 0, level: :error
style.spaces_before_rparen 0, level: :error
style.spaces_in_empty_braces 0, level: :error
style.trailing_newlines 1, level: :error
end
end

View File

@ -6,3 +6,4 @@ gem "berkshelf", "~> 1.4.5"
gem "chefspec", "~> 1.3.0"
gem "foodcritic"
gem "strainer"
gem "tailor"

View File

@ -88,6 +88,7 @@ GEM
ipaddress (0.8.0)
json (1.7.7)
little-plugger (1.1.3)
log_switch (0.4.0)
logging (1.6.2)
little-plugger (>= 1.1.3)
mime-types (1.23)
@ -167,8 +168,16 @@ GEM
strainer (2.1.0)
berkshelf (~> 1.3)
systemu (2.5.2)
tailor (1.2.1)
log_switch (>= 0.3.0)
term-ansicolor (>= 1.0.5)
text-table (>= 1.2.2)
term-ansicolor (1.2.2)
tins (~> 0.8)
text-table (1.2.3)
thor (0.18.1)
timers (1.1.0)
tins (0.8.0)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
@ -195,3 +204,4 @@ DEPENDENCIES
foodcritic
json (<= 1.7.7)
strainer
tailor

View File

@ -1,4 +1,5 @@
# Strainerfile
tailor: bundle exec tailor
knife test: bundle exec knife cookbook test $COOKBOOK
foodcritic: bundle exec foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK
chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec