-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.rubocop.yml
204 lines (158 loc) · 5.94 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
AllCops:
DisabledByDefault: true
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.3
# ------------------------------------ Lints ---------------------------------------------
Lint/CircularArgumentReference:
Enabled: true
Lint/ConditionPosition:
Description: Checks for condition placed in a confusing position relative to the keyword.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
Enabled: true
Lint/Debugger:
Description: 'Check for `debugger` or `binding.pry` statements left in.'
Enabled: true
Lint/DefEndAlignment:
Description: "Makes sure def/ends line up"
Enabled: true
Lint/DeprecatedClassMethods:
Description: 'Check for deprecated class method calls.'
Enabled: true
Lint/DuplicatedKey:
Description: 'Check for duplicate keys in hash literals.'
Enabled: true
Lint/DuplicateMethods:
Description: 'Check for duplicate method definitions.'
Enabled: true
Lint/EachWithObjectArgument:
Description: 'Check for immutable argument given to each_with_object.'
Enabled: true
Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.'
Enabled: true
Lint/EmptyEnsure:
Description: 'Checks for empty ensure block.'
Enabled: true
Lint/EmptyInterpolation:
Description: 'Checks for empty string interpolation.'
Enabled: true
Lint/EndInMethod:
Description: 'END blocks should not be placed inside method definitions.'
Enabled: true
Lint/EnsureReturn:
Description: 'Do not use return in an ensure block.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
Enabled: true
Lint/FloatOutOfRange:
Description: Catches floating-point literals too large or small for Ruby to represent.
Enabled: true
Lint/FormatParameterMismatch:
Description: 'The number of parameters to format/sprint must match the fields.'
Enabled: true
Lint/ImplicitStringConcatenation:
Description: Checks for adjacent string literals on the same line, which could better be represented as a single string literal.
Enabled: true
Lint/IneffectiveAccessModifier:
Description: Checks for attempts to use `private` or `protected` to set the visibility of a class method, which does not work.
Enabled: true
Lint/InheritException:
Description: 'Avoid inheriting from the `Exception` class.'
Enabled: true
Lint/InvalidCharacterLiteral:
Description: Checks for invalid character literals with a non-escaped whitespace character.
Enabled: true
Lint/LiteralInInterpolation:
Description: 'Checks for literals used in interpolation.'
Enabled: true
Lint/NestedMethodDefinition:
Description: 'Do not use nested method definitions.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
Enabled: true
Lint/NextWithoutAccumulator:
Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
Enabled: true
Lint/PercentStringArray:
Description: "Checks for unwanted commas and quotes in %w/%W literals."
Enabled: true
Lint/PercentSymbolArray:
Description: "Checks for unwanted commas and colons in %i/%I literals."
Enabled: true
Lint/RandOne:
Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake.
Enabled: true
Lint/ShadowedException:
Description: Avoid rescuing a higher level exception before a lower level exception.
Enabled: true
Lint/ShadowingOuterLocalVariable:
Description: Do not use the same name as outer local variable for block arguments or block local variables.
Enabled: true
Lint/StringConversionInInterpolation:
Description: 'Checks for Object#to_s usage in string interpolation.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
Enabled: true
Lint/UnneededDisable:
Description: >-
Checks for rubocop:disable comments that can be removed.
Note: this cop is not disabled when disabling all cops.
It must be explicitly disabled.
Enabled: true
Lint/UnreachableCode:
Description: 'Unreachable code.'
Enabled: true
Lint/UnusedBlockArgument:
Description: 'Checks for unused block arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
Enabled: true
Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
Enabled: true
Lint/UselessAccessModifier:
Description: 'Checks for useless access modifiers.'
Enabled: true
Lint/UselessAssignment:
Description: 'Checks for useless assignment to a local variable.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
Enabled: true
# This is done in our tests a lot for clarity
Exclude:
- spec/**/*.rb
Lint/UselessComparison:
Description: 'Checks for comparison of something with itself.'
Enabled: true
Lint/UselessElseWithoutRescue:
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
Enabled: true
Lint/UselessSetterCall:
Description: 'Checks for useless setter call to a local variable.'
Enabled: true
Rails/Output:
Description: 'Checks for calls to puts, print, etc.'
Enabled: true
Rails/PluralizationGrammar:
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
Enabled: true
Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.'
Enabled: true
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
Enabled: true
Rails/UniqBeforePluck:
Description: 'Prefer the use of uniq or distinct before pluck.'
Enabled: true
Style/FileName:
Enabled: true
ExpectMatchingDefinition: false
IgnoreExecutableScripts: true
Style/MethodName:
Enabled: true
EnforcedStyle: snake_case
Style/TrailingBlankLines:
Enabled: true
EnforcedStyle: final_newline
Style/TrailingWhitespace:
Enabled: true