Skip to content

Commit 1c1962b

Browse files
author
David Heinemeier Hansson
authored
Merge pull request #7 from koic/sort_the_cops_mentioned_in_rubocop_yml_by_department
2 parents 4f7b57d + e738873 commit 1c1962b

File tree

1 file changed

+79
-79
lines changed

1 file changed

+79
-79
lines changed

rubocop.yml

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,6 @@ AllCops:
1313
Exclude:
1414
- "data/**/*"
1515

16-
Performance:
17-
Exclude:
18-
- "test/**/*"
19-
20-
# Prefer assert_not over assert !
21-
Rails/AssertNot:
22-
Include:
23-
- "test/**/*"
24-
25-
# Prefer assert_not_x over refute_x
26-
Rails/RefuteMethods:
27-
Include:
28-
- "test/**/*"
29-
30-
# We generally prefer &&/|| but like low-precedence and/or in context
31-
Style/AndOr:
32-
Enabled: false
33-
3416
# Align `when` with `end`.
3517
Layout/CaseIndentation:
3618
Enabled: true
@@ -43,13 +25,6 @@ Layout/CommentIndentation:
4325
Layout/ElseAlignment:
4426
Enabled: true
4527

46-
# Align `end` with the matching keyword or starting expression except for
47-
# assignments, where it should be aligned with the LHS.
48-
Layout/EndAlignment:
49-
Enabled: true
50-
EnforcedStyleAlignWith: variable
51-
AutoCorrect: true
52-
5328
Layout/EmptyLineAfterMagicComment:
5429
Enabled: true
5530

@@ -68,10 +43,12 @@ Layout/EmptyLinesAroundMethodBody:
6843
Layout/EmptyLinesAroundModuleBody:
6944
Enabled: true
7045

71-
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
72-
Style/HashSyntax:
46+
# Align `end` with the matching keyword or starting expression except for
47+
# assignments, where it should be aligned with the LHS.
48+
Layout/EndAlignment:
7349
Enabled: true
74-
EnforcedShorthandSyntax: either
50+
EnforcedStyleAlignWith: variable
51+
AutoCorrect: true
7552

7653
# Method definitions after `private` or `protected` isolated calls need one
7754
# extra level of indentation.
@@ -82,6 +59,10 @@ Layout/IndentationConsistency:
8259
Enabled: false
8360
EnforcedStyle: indented_internal_methods
8461

62+
# Detect hard tabs, no hard tabs.
63+
Layout/IndentationStyle:
64+
Enabled: true
65+
8566
# Two spaces, no tabs (for indentation).
8667
#
8768
# Doesn't behave properly with private-only concerns, so it's disabled.
@@ -103,36 +84,20 @@ Layout/SpaceAroundEqualsInParameterDefault:
10384
Layout/SpaceAroundKeyword:
10485
Enabled: true
10586

106-
Layout/SpaceBeforeComma:
107-
Enabled: true
108-
109-
Layout/SpaceBeforeFirstArg:
110-
Enabled: true
111-
112-
Style/DefWithParentheses:
87+
# Use `foo {}` not `foo{}`.
88+
Layout/SpaceBeforeBlockBraces:
11389
Enabled: true
11490

115-
# Defining a method with parameters needs parentheses.
116-
Style/MethodDefParentheses:
91+
Layout/SpaceBeforeComma:
11792
Enabled: true
11893

119-
# Use `foo {}` not `foo{}`.
120-
Layout/SpaceBeforeBlockBraces:
94+
Layout/SpaceBeforeFirstArg:
12195
Enabled: true
12296

12397
# Use `->(x, y) { x + y }` not `-> (x, y) { x + y }`
12498
Layout/SpaceInLambdaLiteral:
12599
Enabled: true
126100

127-
Style/StabbyLambdaParentheses:
128-
Enabled: true
129-
130-
# Use `foo { bar }` not `foo {bar}`.
131-
# Use `foo { }` not `foo {}`.
132-
Layout/SpaceInsideBlockBraces:
133-
Enabled: true
134-
EnforcedStyleForEmptyBraces: space
135-
136101
# Use `[ a, [ b, c ] ]` not `[a, [b, c]]`
137102
# Use `[]` not `[ ]`
138103
Layout/SpaceInsideArrayLiteralBrackets:
@@ -144,6 +109,12 @@ Layout/SpaceInsideArrayLiteralBrackets:
144109
Layout/SpaceInsideArrayPercentLiteral:
145110
Enabled: true
146111

112+
# Use `foo { bar }` not `foo {bar}`.
113+
# Use `foo { }` not `foo {}`.
114+
Layout/SpaceInsideBlockBraces:
115+
Enabled: true
116+
EnforcedStyleForEmptyBraces: space
117+
147118
# Use `{ a: 1 }` not `{a:1}`.
148119
# Use `{}` not `{ }`.
149120
Layout/SpaceInsideHashLiteralBraces:
@@ -165,21 +136,6 @@ Layout/SpaceInsidePercentLiteralDelimiters:
165136
Layout/SpaceInsideReferenceBrackets:
166137
Enabled: true
167138

168-
# Use `"foo"` not `'foo'` unless escaping is required
169-
Style/StringLiterals:
170-
Enabled: true
171-
EnforcedStyle: double_quotes
172-
Include:
173-
- "app/**/*"
174-
- "config/**/*"
175-
- "lib/**/*"
176-
- "test/**/*"
177-
- "Gemfile"
178-
179-
# Detect hard tabs, no hard tabs.
180-
Layout/IndentationStyle:
181-
Enabled: true
182-
183139
# Blank lines should not have any spaces.
184140
Layout/TrailingEmptyLines:
185141
Enabled: true
@@ -188,35 +144,59 @@ Layout/TrailingEmptyLines:
188144
Layout/TrailingWhitespace:
189145
Enabled: true
190146

191-
# Use quotes for string literals when they are enough.
192-
Style/RedundantPercentQ:
193-
Enabled: false
147+
Lint/RedundantStringCoercion:
148+
Enabled: true
194149

195150
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
196151
Lint/RequireParentheses:
197152
Enabled: true
198153

199-
Lint/RedundantStringCoercion:
200-
Enabled: true
201-
202154
Lint/UriEscapeUnescape:
203155
Enabled: true
204156

205-
Style/ParenthesesAroundCondition:
206-
Enabled: true
157+
Performance:
158+
Exclude:
159+
- "test/**/*"
207160

208-
Style/RedundantReturn:
161+
Performance/FlatMap:
209162
Enabled: true
210-
AllowMultipleReturnValues: true
211163

212-
Style/Semicolon:
164+
Performance/UnfreezeString:
213165
Enabled: true
214-
AllowAsExpressionSeparator: true
166+
167+
# Prefer assert_not over assert !
168+
Rails/AssertNot:
169+
Include:
170+
- "test/**/*"
171+
172+
# Prefer assert_not_x over refute_x
173+
Rails/RefuteMethods:
174+
Include:
175+
- "test/**/*"
176+
177+
# We generally prefer &&/|| but like low-precedence and/or in context
178+
Style/AndOr:
179+
Enabled: false
215180

216181
# Prefer Foo.method over Foo::method
217182
Style/ColonMethodCall:
218183
Enabled: true
219184

185+
Style/DefWithParentheses:
186+
Enabled: true
187+
188+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
189+
Style/HashSyntax:
190+
Enabled: true
191+
EnforcedShorthandSyntax: either
192+
193+
# Defining a method with parameters needs parentheses.
194+
Style/MethodDefParentheses:
195+
Enabled: true
196+
197+
Style/ParenthesesAroundCondition:
198+
Enabled: true
199+
220200
Style/PercentLiteralDelimiters:
221201
Enabled: true
222202
PreferredDelimiters:
@@ -227,14 +207,34 @@ Style/PercentLiteralDelimiters:
227207
"%w": "[]"
228208
"%W": "[]"
229209

230-
Style/TrailingCommaInArrayLiteral:
210+
# Use quotes for string literals when they are enough.
211+
Style/RedundantPercentQ:
212+
Enabled: false
213+
214+
Style/RedundantReturn:
231215
Enabled: true
216+
AllowMultipleReturnValues: true
232217

233-
Style/TrailingCommaInHashLiteral:
218+
Style/Semicolon:
234219
Enabled: true
220+
AllowAsExpressionSeparator: true
235221

236-
Performance/FlatMap:
222+
Style/StabbyLambdaParentheses:
237223
Enabled: true
238224

239-
Performance/UnfreezeString:
225+
# Use `"foo"` not `'foo'` unless escaping is required
226+
Style/StringLiterals:
227+
Enabled: true
228+
EnforcedStyle: double_quotes
229+
Include:
230+
- "app/**/*"
231+
- "config/**/*"
232+
- "lib/**/*"
233+
- "test/**/*"
234+
- "Gemfile"
235+
236+
Style/TrailingCommaInArrayLiteral:
237+
Enabled: true
238+
239+
Style/TrailingCommaInHashLiteral:
240240
Enabled: true

0 commit comments

Comments
 (0)