forked from rcbops-cookbooks/nova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tailor
181 lines (175 loc) · 7.66 KB
/
.tailor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#------------------------------------------------------------------------------
# Horizontal Whitespace
#------------------------------------------------------------------------------
# allow_hard_tabs True to let hard tabs be considered a single space.
# Default: false
#
# allow_trailing_line_spaces
# True to skip detecting extra spaces at the ends of
# lines.
# Default: false
#
# indentation_spaces The number of spaces to consider a proper indent.
# Default: 2
#
# max_line_length The maximum number of characters in a line before
# tailor complains.
# Default: 80
# spaces_after_comma Number of spaces to expect after a comma.
# Default: 1
#
# spaces_before_comma Number of spaces to expect before a comma.
# Default: 0
#
# spaces_after_lbrace The number of spaces to expect after an lbrace ('{').
# Default: 1
#
# spaces_before_lbrace The number of spaces to expect before an lbrace ('{').
# Default: 1
#
# spaces_before_rbrace The number of spaces to expect before an rbrace ('}').
# Default: 1
#
# spaces_in_empty_braces The number of spaces to expect between braces when
# there's nothing in the braces (i.e. {}).
# Default: 0
#
# spaces_after_lbracket The number of spaces to expect after an
# lbracket ('[').
# Default: 0
#
# spaces_before_rbracket The number of spaces to expect before an
# rbracket (']').
# Default: 0
#
# spaces_after_lparen The number of spaces to expect after an
# lparen ('(').
# Default: 0
#
# spaces_before_rparen The number of spaces to expect before an
# rbracket (')').
# Default: 0
#
#------------------------------------------------------------------------------
# Naming
#------------------------------------------------------------------------------
# allow_camel_case_methods
# Setting to true skips detection of camel-case method
# names (i.e. def myMethod).
# Default: false
#
# allow_screaming_snake_case_classes
# Setting to true skips detection of screaming
# snake-case class names (i.e. My_Class).
# Default: false
#
#------------------------------------------------------------------------------
# Vertical Whitespace
#------------------------------------------------------------------------------
# max_code_lines_in_class The number of lines of code in a class to allow before
# tailor will warn you.
# Default: 300
#
# max_code_lines_in_method
# The number of lines of code in a method to allow
# before tailor will warn you.
# Default: 30
#
# trailing_newlines The number of newlines that should be at the end of
# the file.
# Default: 1
#
#
# Generic configuration for tailor
#
Tailor.config do |config|
config.formatters "text"
config.file_set 'recipes/**/*.rb', :recipes do |style|
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 120, level: :error
style.max_code_lines_in_method 30, level: :error
style.max_line_length 120, 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
config.file_set 'libraries/**/*.rb', :libraries do |style|
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 120, level: :error
style.max_code_lines_in_method 30, level: :error
style.max_line_length 120, 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
config.file_set 'providers/**/*.rb', :providers do |style|
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 120, level: :error
style.max_code_lines_in_method 30, level: :error
style.max_line_length 150, 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
config.file_set 'resources/**/*.rb', :resources do |style|
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 120, level: :error
style.max_code_lines_in_method 30, level: :error
style.max_line_length 120, 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