Skip to content

Commit c5b8a16

Browse files
committed
Autocorrect the easy stuff
1 parent 8c90c4c commit c5b8a16

23 files changed

+125
-337
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Style/IndentHash:
1515
EnforcedStyle: consistent
1616

1717
Style/TrailingComma:
18-
EnforcedStyleForMultiline: comma
18+
EnforcedStyleForMultiline: consistent_comma
1919

2020
Style/TrivialAccessors:
2121
AllowPredicates: true

.rubocop_todo.yml

Lines changed: 5 additions & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This configuration was generated by `rubocop --auto-gen-config`
2-
# on 2015-03-12 17:39:18 -0700 using RuboCop version 0.29.1.
2+
# on 2015-03-12 17:46:21 -0700 using RuboCop version 0.29.1.
33
# The point is for the user to remove these configuration records
44
# one by one as the offenses are removed from the code base.
55
# Note that changes in the inspected code, or installation of new
@@ -10,16 +10,6 @@
1010
Lint/AssignmentInCondition:
1111
Enabled: false
1212

13-
# Offense count: 1
14-
# Cop supports --auto-correct.
15-
Lint/DeprecatedClassMethods:
16-
Enabled: false
17-
18-
# Offense count: 1
19-
# Configuration parameters: AlignWith, SupportedStyles.
20-
Lint/EndAlignment:
21-
Enabled: false
22-
2313
# Offense count: 1
2414
Lint/Eval:
2515
Enabled: false
@@ -59,9 +49,9 @@ Metrics/BlockNesting:
5949

6050
# Offense count: 2
6151
Metrics/CyclomaticComplexity:
62-
Max: 21
52+
Max: 23
6353

64-
# Offense count: 244
54+
# Offense count: 238
6555
# Configuration parameters: AllowURI, URISchemes.
6656
Metrics/LineLength:
6757
Max: 232
@@ -77,13 +67,7 @@ Metrics/PerceivedComplexity:
7767

7868
# Offense count: 40
7969
# Cop supports --auto-correct.
80-
Style/Blocks:
81-
Enabled: false
82-
83-
# Offense count: 8
84-
# Cop supports --auto-correct.
85-
# Configuration parameters: EnforcedStyle, SupportedStyles.
86-
Style/BracesAroundHashParameters:
70+
Style/BlockDelimiters:
8771
Enabled: false
8872

8973
# Offense count: 1
@@ -95,16 +79,6 @@ Style/ClassAndModuleChildren:
9579
Style/ClassVars:
9680
Enabled: false
9781

98-
# Offense count: 2
99-
# Cop supports --auto-correct.
100-
Style/CommentIndentation:
101-
Enabled: false
102-
103-
# Offense count: 1
104-
# Cop supports --auto-correct.
105-
Style/DeprecatedHashMethods:
106-
Enabled: false
107-
10882
# Offense count: 9
10983
Style/Documentation:
11084
Enabled: false
@@ -113,27 +87,6 @@ Style/Documentation:
11387
Style/DoubleNegation:
11488
Enabled: false
11589

116-
# Offense count: 2
117-
# Cop supports --auto-correct.
118-
Style/ElseAlignment:
119-
Enabled: false
120-
121-
# Offense count: 1
122-
# Cop supports --auto-correct.
123-
Style/EmptyLines:
124-
Enabled: false
125-
126-
# Offense count: 1
127-
# Cop supports --auto-correct.
128-
Style/EmptyLinesAroundAccessModifier:
129-
Enabled: false
130-
131-
# Offense count: 2
132-
# Cop supports --auto-correct.
133-
# Configuration parameters: EnforcedStyle, SupportedStyles.
134-
Style/EmptyLinesAroundModuleBody:
135-
Enabled: false
136-
13790
# Offense count: 9
13891
# Configuration parameters: AllowedVariables.
13992
Style/GlobalVars:
@@ -144,187 +97,26 @@ Style/GlobalVars:
14497
Style/IfUnlessModifier:
14598
Enabled: false
14699

147-
# Offense count: 1
148-
# Cop supports --auto-correct.
149-
Style/IndentationConsistency:
150-
Enabled: false
151-
152-
# Offense count: 3
153-
# Cop supports --auto-correct.
154-
# Configuration parameters: Width.
155-
Style/IndentationWidth:
156-
Enabled: false
157-
158-
# Offense count: 3
159-
# Cop supports --auto-correct.
160-
# Configuration parameters: EnforcedStyle, SupportedStyles.
161-
Style/MethodDefParentheses:
162-
Enabled: false
163-
164100
# Offense count: 1
165101
Style/MultilineBlockChain:
166102
Enabled: false
167103

168-
# Offense count: 2
169-
# Cop supports --auto-correct.
170-
Style/MultilineIfThen:
171-
Enabled: false
172-
173-
# Offense count: 1
174-
# Cop supports --auto-correct.
175-
Style/NegatedIf:
176-
Enabled: false
177-
178-
# Offense count: 1
179-
# Cop supports --auto-correct.
180-
Style/NegatedWhile:
181-
Enabled: false
182-
183-
# Offense count: 1
184-
# Cop supports --auto-correct.
185-
Style/Not:
186-
Enabled: false
187-
188104
# Offense count: 13
189105
# Cop supports --auto-correct.
190106
Style/NumericLiterals:
191107
MinDigits: 20
192108

193-
# Offense count: 7
194-
# Cop supports --auto-correct.
195-
# Configuration parameters: PreferredDelimiters.
196-
Style/PercentLiteralDelimiters:
197-
Enabled: false
198-
199-
# Offense count: 1
200-
# Configuration parameters: SupportedStyles.
201-
Style/RaiseArgs:
202-
EnforcedStyle: compact
203-
204-
# Offense count: 1
205-
# Cop supports --auto-correct.
206-
Style/RedundantSelf:
207-
Enabled: false
208-
209-
# Offense count: 1
210-
Style/RegexpLiteral:
211-
MaxSlashes: 0
212-
213-
# Offense count: 2
214-
# Cop supports --auto-correct.
215-
# Configuration parameters: EnforcedStyle, SupportedStyles.
216-
Style/SignalException:
217-
Enabled: false
218-
219-
# Offense count: 9
220-
# Cop supports --auto-correct.
221-
Style/SingleSpaceBeforeFirstArg:
222-
Enabled: false
223-
224-
# Offense count: 6
225-
# Cop supports --auto-correct.
226-
Style/SpaceAfterComma:
227-
Enabled: false
228-
229-
# Offense count: 1
230-
# Cop supports --auto-correct.
231-
Style/SpaceAfterControlKeyword:
232-
Enabled: false
233-
234-
# Offense count: 1
235-
# Cop supports --auto-correct.
236-
Style/SpaceAfterNot:
237-
Enabled: false
238-
239-
# Offense count: 3
240-
# Cop supports --auto-correct.
241-
# Configuration parameters: EnforcedStyle, SupportedStyles.
242-
Style/SpaceAroundEqualsInParameterDefault:
243-
Enabled: false
244-
245-
# Offense count: 5
246-
# Cop supports --auto-correct.
247-
Style/SpaceAroundOperators:
248-
Enabled: false
249-
250-
# Offense count: 5
251-
# Cop supports --auto-correct.
252-
# Configuration parameters: EnforcedStyle, SupportedStyles.
253-
Style/SpaceBeforeBlockBraces:
254-
Enabled: false
255-
256-
# Offense count: 14
257-
# Cop supports --auto-correct.
258-
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
259-
Style/SpaceInsideBlockBraces:
260-
Enabled: false
261-
262-
# Offense count: 2
263-
# Cop supports --auto-correct.
264-
Style/SpaceInsideBrackets:
265-
Enabled: false
266-
267-
# Offense count: 8
268-
# Cop supports --auto-correct.
269-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
270-
Style/SpaceInsideHashLiteralBraces:
271-
Enabled: false
272-
273-
# Offense count: 4
274-
# Cop supports --auto-correct.
275-
Style/SpaceInsideParens:
276-
Enabled: false
277-
278-
# Offense count: 2
279-
# Cop supports --auto-correct.
280-
Style/SpecialGlobalVars:
281-
Enabled: false
282-
283-
# Offense count: 550
109+
# Offense count: 549
284110
# Cop supports --auto-correct.
285111
# Configuration parameters: EnforcedStyle, SupportedStyles.
286112
Style/StringLiterals:
287113
Enabled: false
288114

289-
# Offense count: 1
290-
# Cop supports --auto-correct.
291-
# Configuration parameters: IgnoredMethods.
292-
Style/SymbolProc:
293-
Enabled: false
294-
295-
# Offense count: 2
296-
# Cop supports --auto-correct.
297-
# Configuration parameters: EnforcedStyle, SupportedStyles.
298-
Style/TrailingBlankLines:
299-
Enabled: false
300-
301-
# Offense count: 6
302-
# Cop supports --auto-correct.
303-
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
304-
Style/TrailingComma:
305-
Enabled: false
306-
307115
# Offense count: 2
308116
Style/UnlessElse:
309117
Enabled: false
310118

311-
# Offense count: 4
312-
# Cop supports --auto-correct.
313-
Style/UnneededPercentQ:
314-
Enabled: false
315-
316-
# Offense count: 1
317-
# Cop supports --auto-correct.
318-
Style/WhileUntilDo:
319-
Enabled: false
320-
321119
# Offense count: 1
322120
# Configuration parameters: MaxLineLength.
323121
Style/WhileUntilModifier:
324122
Enabled: false
325-
326-
# Offense count: 4
327-
# Cop supports --auto-correct.
328-
# Configuration parameters: WordRegex.
329-
Style/WordArray:
330-
MinSize: 5

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gem 'rake-compiler', '~> 0.9.5'
88
group :test do
99
gem 'eventmachine' unless RUBY_PLATFORM =~ /mswin|mingw/
1010
gem 'rspec', '~> 3.2'
11-
gem 'rubocop', '~> 0.29.1' unless RUBY_VERSION =~ /1.8/
11+
gem 'rubocop', '~> 0.32.0' unless RUBY_VERSION =~ /1.8/
1212
end
1313

1414
group :benchmarks do

benchmark/allocations.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
require 'rubygems'
55
require 'active_record'
66

7-
raise Mysql2::Error.new("GC allocation benchmarks only supported on Ruby 1.9!") unless RUBY_VERSION > '1.9'
8-
97
ActiveRecord::Base.default_timezone = :local
108
ActiveRecord::Base.time_zone_aware_attributes = true
119

benchmark/setup_db.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def insert_record(args)
8686
:medium_int_test => rand(8388607),
8787
:int_test => rand(2147483647),
8888
:big_int_test => rand(9223372036854775807),
89-
:float_test => rand(32767)/1.87,
89+
:float_test => rand(32767) / 1.87,
9090
:float_zero_test => 0.0,
91-
:double_test => rand(8388607)/1.87,
92-
:decimal_test => rand(8388607)/1.87,
91+
:double_test => rand(8388607) / 1.87,
92+
:decimal_test => rand(8388607) / 1.87,
9393
:decimal_zero_test => 0,
9494
:date_test => '2010-4-4',
9595
:date_time_test => '2010-4-4 11:44:00',
@@ -108,8 +108,8 @@ def insert_record(args)
108108
:medium_text_test => twenty5_paragraphs,
109109
:long_blob_test => twenty5_paragraphs,
110110
:long_text_test => twenty5_paragraphs,
111-
:enum_test => ['val1', 'val2'][rand(2)],
112-
:set_test => ['val1', 'val2', 'val1,val2'][rand(3)]
111+
:enum_test => %w(val1 val2).sample,
112+
:set_test => %w(val1 val2 val1,val2).sample,
113113
)
114114
if n % 100 == 0
115115
$stdout.putc '.'

examples/eventmachine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
defer2.callback do |result|
1919
puts "Result: #{result.to_a.inspect}"
2020
end
21-
end
21+
end

0 commit comments

Comments
 (0)