Add tailor ruby style check
Partial fix for bug 1185536 Change-Id: Id2ebacb2c1627f6f933e34f2b560c614a92c812b
This commit is contained in:
		
							
								
								
									
										25
									
								
								.tailor
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.tailor
									
									
									
									
									
										Normal 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
 | 
			
		||||
							
								
								
									
										1
									
								
								Gemfile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Gemfile
									
									
									
									
									
								
							@@ -6,3 +6,4 @@ gem "berkshelf", "~> 1.4.5"
 | 
			
		||||
gem "chefspec", "~> 1.3.0"
 | 
			
		||||
gem "foodcritic"
 | 
			
		||||
gem "strainer"
 | 
			
		||||
gem "tailor"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								Gemfile.lock
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Gemfile.lock
									
									
									
									
									
								
							@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user