|
| 1 | +#------------------------------------------------------------------------------ |
| 2 | +# Horizontal Whitespace |
| 3 | +#------------------------------------------------------------------------------ |
| 4 | +# allow_hard_tabs True to let hard tabs be considered a single space. |
| 5 | +# Default: false |
| 6 | +# |
| 7 | +# allow_trailing_line_spaces |
| 8 | +# True to skip detecting extra spaces at the ends of |
| 9 | +# lines. |
| 10 | +# Default: false |
| 11 | +# |
| 12 | +# indentation_spaces The number of spaces to consider a proper indent. |
| 13 | +# Default: 2 |
| 14 | +# |
| 15 | +# max_line_length The maximum number of characters in a line before |
| 16 | +# tailor complains. |
| 17 | +# Default: 80 |
| 18 | +# spaces_after_comma Number of spaces to expect after a comma. |
| 19 | +# Default: 1 |
| 20 | +# |
| 21 | +# spaces_before_comma Number of spaces to expect before a comma. |
| 22 | +# Default: 0 |
| 23 | +# |
| 24 | +# spaces_after_lbrace The number of spaces to expect after an lbrace ('{'). |
| 25 | +# Default: 1 |
| 26 | +# |
| 27 | +# spaces_before_lbrace The number of spaces to expect before an lbrace ('{'). |
| 28 | +# Default: 1 |
| 29 | +# |
| 30 | +# spaces_before_rbrace The number of spaces to expect before an rbrace ('}'). |
| 31 | +# Default: 1 |
| 32 | +# |
| 33 | +# spaces_in_empty_braces The number of spaces to expect between braces when |
| 34 | +# there's nothing in the braces (i.e. {}). |
| 35 | +# Default: 0 |
| 36 | +# |
| 37 | +# spaces_after_lbracket The number of spaces to expect after an |
| 38 | +# lbracket ('['). |
| 39 | +# Default: 0 |
| 40 | +# |
| 41 | +# spaces_before_rbracket The number of spaces to expect before an |
| 42 | +# rbracket (']'). |
| 43 | +# Default: 0 |
| 44 | +# |
| 45 | +# spaces_after_lparen The number of spaces to expect after an |
| 46 | +# lparen ('('). |
| 47 | +# Default: 0 |
| 48 | +# |
| 49 | +# spaces_before_rparen The number of spaces to expect before an |
| 50 | +# rbracket (')'). |
| 51 | +# Default: 0 |
| 52 | +# |
| 53 | +#------------------------------------------------------------------------------ |
| 54 | +# Naming |
| 55 | +#------------------------------------------------------------------------------ |
| 56 | +# allow_camel_case_methods |
| 57 | +# Setting to true skips detection of camel-case method |
| 58 | +# names (i.e. def myMethod). |
| 59 | +# Default: false |
| 60 | +# |
| 61 | +# allow_screaming_snake_case_classes |
| 62 | +# Setting to true skips detection of screaming |
| 63 | +# snake-case class names (i.e. My_Class). |
| 64 | +# Default: false |
| 65 | +# |
| 66 | +#------------------------------------------------------------------------------ |
| 67 | +# Vertical Whitespace |
| 68 | +#------------------------------------------------------------------------------ |
| 69 | +# max_code_lines_in_class The number of lines of code in a class to allow before |
| 70 | +# tailor will warn you. |
| 71 | +# Default: 300 |
| 72 | +# |
| 73 | +# max_code_lines_in_method |
| 74 | +# The number of lines of code in a method to allow |
| 75 | +# before tailor will warn you. |
| 76 | +# Default: 30 |
| 77 | +# |
| 78 | +# trailing_newlines The number of newlines that should be at the end of |
| 79 | +# the file. |
| 80 | +# Default: 1 |
| 81 | +# |
| 82 | +Tailor.config do |config| |
| 83 | + config.formatters "text" |
| 84 | + config.file_set 'lib/**/*.rb' do |style| |
| 85 | + style.allow_camel_case_methods false, level: :error |
| 86 | + style.allow_hard_tabs false, level: :error |
| 87 | + style.allow_screaming_snake_case_classes false, level: :error |
| 88 | + style.allow_trailing_line_spaces false, level: :error |
| 89 | + style.allow_invalid_ruby false, level: :warn |
| 90 | + style.indentation_spaces 2, level: :error |
| 91 | + style.max_code_lines_in_class 300, level: :error |
| 92 | + style.max_code_lines_in_method 30, level: :error |
| 93 | + style.max_line_length 80, level: :error |
| 94 | + style.spaces_after_comma 1, level: :off |
| 95 | + style.spaces_after_lbrace 1, level: :error |
| 96 | + style.spaces_after_lbracket 0, level: :error |
| 97 | + style.spaces_after_lparen 0, level: :error |
| 98 | + style.spaces_before_comma 0, level: :error |
| 99 | + style.spaces_before_lbrace 1, level: :off |
| 100 | + style.spaces_before_rbrace 1, level: :error |
| 101 | + style.spaces_before_rbracket 0, level: :error |
| 102 | + style.spaces_before_rparen 0, level: :error |
| 103 | + style.spaces_in_empty_braces 0, level: :error |
| 104 | + style.trailing_newlines 1, level: :error |
| 105 | + end |
| 106 | +end |
0 commit comments