diff --git a/.tailor b/.tailor new file mode 100644 index 0000000..99f0dcf --- /dev/null +++ b/.tailor @@ -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 diff --git a/Gemfile b/Gemfile index 9223595..ffbff4a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,4 @@ gem "berkshelf", "~> 1.4.5" gem "chefspec", "~> 1.3.0" gem "foodcritic" gem "strainer" +gem "tailor" diff --git a/Gemfile.lock b/Gemfile.lock index 688e355..fb9593e 100644 --- a/Gemfile.lock +++ b/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 diff --git a/Strainerfile b/Strainerfile index 541388e..7e292b4 100644 --- a/Strainerfile +++ b/Strainerfile @@ -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