forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
219 lines (165 loc) · 4.55 KB
/
.rubocop.yml
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# This is the default configuration file with all checking enabled. It is also
# the configuration used to check the rubocop source code.
# Use UTF-8 as the source file encoding.
Encoding:
Enabled: true
# Limit lines to 80 characters.
LineLength:
Enabled: true
Max: 79
# No hard tabs.
Tab:
Enabled: true
# Avoid trailing whitespace.
TrailingWhitespace:
Enabled: true
# Indent when as deep as case.
Indentation:
Enabled: true
# Use empty lines between defs.
EmptyLines:
Enabled: true
# Use spaces around operators.
SpaceAroundOperators:
Enabled: true
# Use spaces around { and before }.
SpaceAroundBraces:
Enabled: true
# No spaces after ( or before ).
SpaceInsideParens:
Enabled: true
# No spaces after [ or before ].
SpaceInsideBrackets:
Enabled: true
# Use spaces after commas.
SpaceAfterComma:
Enabled: true
# Use spaces after semicolons.
SpaceAfterSemicolon:
Enabled: true
# Use spaces after colons.
SpaceAfterColon:
Enabled: true
# Prefer symbols instead of strings as hash keys.
HashSyntax:
Enabled: true
# Use Unix-style line endings.
EndOfLine:
Enabled: true
# Add underscores to large numeric literals to improve their readability.
NumericLiterals:
Enabled: true
# Align the parameters of a method call if they span more than one line.
AlignParameters:
Enabled: true
# Use def with parentheses when there are arguments.
DefWithParentheses:
Enabled: true
# Omit the parentheses when the method doesn't accept any arguments.
DefWithoutParentheses:
Enabled: true
# Never use if x; .... Use the ternary operator instead.
IfWithSemicolon:
Enabled: true
# Never use then for multi-line if/unless.
MultilineIfThen:
Enabled: true
# Favor the ternary operator(?:) over if/then/else/end constructs.
OneLineConditional:
Enabled: true
# Avoid using {...} for multi-line blocks (multiline chaining is always ugly).
MultilineBlocks:
Enabled: true
# Prefer {...} over do...end for single-line blocks.
SingleLineBlocks:
Enabled: true
# Avoid parameter lists longer than three or four parameters.
ParameterLists:
Enabled: true
# Prefer ' strings when you don't need string interpolation or special symbols.
StringLiterals:
Enabled: true
# Avoid multi-line ?: (the ternary operator); use if/unless instead.
MultilineTernaryOperator:
Enabled: true
# Use one expression per branch in a ternary operator.
NestedTernaryOperator:
Enabled: true
# Never use unless with else. Rewrite these with the positive case first.
UnlessElse:
Enabled: true
# Use &&/|| for boolean expressions, and/or for control flow.
AmpersandsPipesVsAndOr:
Enabled: true
# Use when x then ... for one-line cases.
WhenThen:
Enabled: true
# Favor modifier if/unless usage when you have a single-line body.
IfUnlessModifier:
Enabled: true
# Favor modifier while/until usage when you have a single-line body.
WhileUntilModifier:
Enabled: true
# Favor unless over if for negative conditions (or control flow or).
FavorUnlessOverNegatedIf:
Enabled: true
# Favor until over while for negative conditions.
FavorUntilOverNegatedWhile:
Enabled: true
# Use spaces around the = operator when assigning default values in def params.
SpaceAroundEqualsInParameterDefault:
Enabled: true
# Use the new lambda literal syntax.
NewLambdaLiteral:
Enabled: true
# Don't use parentheses around the condition of an if/unless/while.
ParenthesesAroundCondition:
Enabled: true
# Use snake_case for symbols, methods and variables.
MethodAndVariableSnakeCase:
Enabled: true
# Use CamelCase for classes and modules.
ClassAndModuleCamelCase:
Enabled: true
# Causes Ruby to check the syntax of the script and exit without executing.
Syntax:
Enabled: true
# Preferred collection methods.
CollectionMethods:
Enabled: true
# Prefer each over for.
AvoidFor:
Enabled: true
# Avoid Perl-style global variables.
AvoidPerlisms:
Enabled: true
# Avoid Perl-style regex back references.
AvoidPerlBackrefs:
Enabled: true
# Avoid the use of class variables.
AvoidClassVars:
Enabled: true
# Symbol literals should use snake_case.
SymbolSnakeCase:
Enabled: true
# Don't interpolate global, instance and class variables directly in strings.
VariableInterpolation:
Enabled: true
# Don't use semicolons to terminate expressions.
Semicolon:
Enabled: true
# Use sprintf instead of %
FavorSprintf:
Enabled: true
# Use alias_method instead of alias.
Alias:
Enabled: true
# Avoid using rescue in its modifier form.
RescueModifier:
Enabled: true
# Avoid the use of %q, %Q, %s and %x.
PercentLiterals:
Enabled: true
# Prefer () as delimiters for all % literals.
BraceAfterPercent:
Enabled: true