Skip to content

Commit 7a97790

Browse files
committed
Fix offences by rubocop supporting autocorrection
1 parent 073a508 commit 7a97790

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+333
-547
lines changed

.rubocop_todo.yml

+6-312
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2016-09-06 11:35:34 +0700 using RuboCop version 0.42.0.
3+
# on 2016-09-06 12:08:00 +0700 using RuboCop version 0.42.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 42
9+
# Offense count: 41
1010
Metrics/AbcSize:
11-
Max: 49
11+
Max: 47
1212

1313
# Offense count: 4
1414
# Configuration parameters: CountComments.
@@ -19,7 +19,7 @@ Metrics/ClassLength:
1919
Metrics/CyclomaticComplexity:
2020
Max: 13
2121

22-
# Offense count: 1476
22+
# Offense count: 1455
2323
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
2424
# URISchemes: http, https
2525
Metrics/LineLength:
@@ -51,15 +51,6 @@ Style/AsciiComments:
5151
- 'lib/chewy/type/mapping.rb'
5252
- 'spec/chewy_spec.rb'
5353

54-
# Offense count: 6
55-
# Cop supports --auto-correct.
56-
Style/CharacterLiteral:
57-
Exclude:
58-
- 'lib/chewy.rb'
59-
- 'lib/chewy/index.rb'
60-
- 'lib/chewy/query/nodes/field.rb'
61-
- 'lib/tasks/chewy.rake'
62-
6354
# Offense count: 1
6455
# Configuration parameters: EnforcedStyle, SupportedStyles.
6556
# SupportedStyles: nested, compact
@@ -71,72 +62,6 @@ Style/ClassAndModuleChildren:
7162
Style/Documentation:
7263
Enabled: false
7364

74-
# Offense count: 1
75-
# Cop supports --auto-correct.
76-
# Configuration parameters: AllowAdjacentOneLineDefs.
77-
Style/EmptyLineBetweenDefs:
78-
Exclude:
79-
- 'lib/chewy/strategy/base.rb'
80-
81-
# Offense count: 4
82-
# Cop supports --auto-correct.
83-
Style/EmptyLines:
84-
Exclude:
85-
- 'spec/chewy/fields/base_spec.rb'
86-
- 'spec/chewy/query/nodes/has_child_spec.rb'
87-
- 'spec/chewy/query/nodes/has_parent_spec.rb'
88-
- 'spec/chewy/query/pagination/will_paginage_spec.rb'
89-
90-
# Offense count: 3
91-
# Cop supports --auto-correct.
92-
Style/EmptyLinesAroundAccessModifier:
93-
Exclude:
94-
- 'lib/chewy/minitest/search_index_receiver.rb'
95-
- 'lib/chewy/query/nodes/has_child.rb'
96-
- 'lib/chewy/query/nodes/has_parent.rb'
97-
98-
# Offense count: 5
99-
# Cop supports --auto-correct.
100-
# Configuration parameters: EnforcedStyle, SupportedStyles.
101-
# SupportedStyles: empty_lines, no_empty_lines
102-
Style/EmptyLinesAroundClassBody:
103-
Exclude:
104-
- 'lib/chewy/index/settings.rb'
105-
- 'lib/chewy/minitest/search_index_receiver.rb'
106-
- 'lib/chewy/rake_helper.rb'
107-
- 'lib/chewy/type/adapter/active_record.rb'
108-
- 'lib/chewy/type/adapter/mongoid.rb'
109-
110-
# Offense count: 3
111-
# Cop supports --auto-correct.
112-
# Configuration parameters: EnforcedStyle, SupportedStyles.
113-
# SupportedStyles: empty_lines, no_empty_lines
114-
Style/EmptyLinesAroundModuleBody:
115-
Exclude:
116-
- 'lib/chewy.rb'
117-
- 'lib/chewy/minitest/helpers.rb'
118-
- 'lib/chewy/query/compose.rb'
119-
120-
# Offense count: 7
121-
# Cop supports --auto-correct.
122-
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
123-
Style/ExtraSpacing:
124-
Exclude:
125-
- 'Guardfile'
126-
- 'lib/chewy/railtie.rb'
127-
- 'spec/chewy/index_spec.rb'
128-
- 'spec/chewy/query_spec.rb'
129-
- 'spec/chewy/type/import_spec.rb'
130-
131-
# Offense count: 13
132-
# Cop supports --auto-correct.
133-
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
134-
# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
135-
Style/FirstParameterIndentation:
136-
Exclude:
137-
- 'spec/chewy/fields/base_spec.rb'
138-
- 'spec/chewy/type/import_spec.rb'
139-
14065
# Offense count: 2
14166
# Configuration parameters: MinBodyLength.
14267
Style/GuardClause:
@@ -149,13 +74,6 @@ Style/IfInsideElse:
14974
Exclude:
15075
- 'lib/chewy/rspec/update_index.rb'
15176

152-
# Offense count: 1
153-
# Cop supports --auto-correct.
154-
# Configuration parameters: MaxLineLength.
155-
Style/IfUnlessModifier:
156-
Exclude:
157-
- 'lib/chewy/minitest/helpers.rb'
158-
15977
# Offense count: 2
16078
Style/IfUnlessModifierOfIfUnless:
16179
Exclude:
@@ -181,14 +99,6 @@ Style/MultilineBlockChain:
18199
- 'lib/chewy/type/import.rb'
182100
- 'lib/chewy/type/observe.rb'
183101

184-
# Offense count: 2
185-
# Cop supports --auto-correct.
186-
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
187-
# SupportedStyles: aligned, indented
188-
Style/MultilineOperationIndentation:
189-
Exclude:
190-
- 'lib/chewy/rspec/update_index.rb'
191-
192102
# Offense count: 7
193103
Style/MultilineTernaryOperator:
194104
Exclude:
@@ -199,93 +109,32 @@ Style/MultilineTernaryOperator:
199109
- 'lib/chewy/type/adapter/orm.rb'
200110
- 'lib/chewy/type/observe.rb'
201111

202-
# Offense count: 10
203-
# Cop supports --auto-correct.
204-
Style/MutableConstant:
205-
Exclude:
206-
- 'lib/chewy/query/criteria.rb'
207-
- 'lib/chewy/query/nodes/bool.rb'
208-
- 'lib/chewy/query/nodes/equal.rb'
209-
- 'lib/chewy/query/nodes/range.rb'
210-
- 'lib/chewy/query/nodes/regexp.rb'
211-
- 'lib/chewy/type.rb'
212-
- 'lib/chewy/type/import.rb'
213-
- 'lib/chewy/version.rb'
214-
- 'spec/support/mongoid.rb'
215-
216-
# Offense count: 13
217-
# Cop supports --auto-correct.
218-
Style/NestedParenthesizedCalls:
219-
Exclude:
220-
- 'spec/chewy/minitest/search_index_receiver_spec.rb'
221-
- 'spec/chewy/type/adapter/active_record_spec.rb'
222-
- 'spec/chewy/type/adapter/mongoid_spec.rb'
223-
- 'spec/chewy/type/adapter/object_spec.rb'
224-
- 'spec/chewy/type/adapter/sequel_spec.rb'
225-
- 'spec/chewy/type/import_spec.rb'
226-
227112
# Offense count: 2
228113
Style/NestedTernaryOperator:
229114
Exclude:
230115
- 'lib/chewy/fields/base.rb'
231116
- 'lib/chewy/type/adapter/orm.rb'
232117

233-
# Offense count: 5
118+
# Offense count: 3
234119
# Cop supports --auto-correct.
235120
Style/NilComparison:
236121
Exclude:
237122
- 'spec/chewy/query/filters_spec.rb'
238-
- 'spec/chewy/query/nodes/exists_spec.rb'
239123
- 'spec/chewy/query/nodes/missing_spec.rb'
240124

241-
# Offense count: 2
125+
# Offense count: 4
242126
# Cop supports --auto-correct.
243127
# Configuration parameters: IncludeSemanticChanges.
244128
Style/NonNilCheck:
245129
Exclude:
246130
- 'spec/chewy/query/filters_spec.rb'
247131
- 'spec/chewy/query/nodes/exists_spec.rb'
248132

249-
# Offense count: 4
250-
# Cop supports --auto-correct.
251-
Style/NumericLiterals:
252-
MinDigits: 6
253-
254-
# Offense count: 6
255-
# Cop supports --auto-correct.
256-
# Configuration parameters: EnforcedStyle, SupportedStyles.
257-
# SupportedStyles: predicate, comparison
258-
Style/NumericPredicate:
259-
Exclude:
260-
- 'lib/chewy/fields/base.rb'
261-
- 'lib/chewy/fields/root.rb'
262-
- 'lib/chewy/runtime/version.rb'
263-
- 'lib/chewy/type/observe.rb'
264-
- 'lib/chewy/type/witchcraft.rb'
265-
266133
# Offense count: 8
267134
Style/OpMethod:
268135
Exclude:
269136
- 'lib/chewy/query/nodes/field.rb'
270137

271-
# Offense count: 5
272-
# Cop supports --auto-correct.
273-
Style/ParallelAssignment:
274-
Exclude:
275-
- 'lib/chewy/fields/base.rb'
276-
- 'lib/chewy/query/nodes/bool.rb'
277-
- 'lib/chewy/query/nodes/prefix.rb'
278-
- 'lib/chewy/type/crutch.rb'
279-
- 'lib/chewy/type/mapping.rb'
280-
281-
# Offense count: 3
282-
# Cop supports --auto-correct.
283-
# Configuration parameters: PreferredDelimiters.
284-
Style/PercentLiteralDelimiters:
285-
Exclude:
286-
- 'lib/chewy/journal.rb'
287-
- 'spec/chewy/type/witchcraft_spec.rb'
288-
289138
# Offense count: 2
290139
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
291140
# NamePrefix: is_, has_, have_
@@ -295,158 +144,3 @@ Style/PredicateName:
295144
Exclude:
296145
- 'spec/**/*'
297146
- 'lib/chewy/query/filters.rb'
298-
299-
# Offense count: 1
300-
# Cop supports --auto-correct.
301-
Style/Proc:
302-
Exclude:
303-
- 'lib/chewy/type/observe.rb'
304-
305-
# Offense count: 7
306-
# Cop supports --auto-correct.
307-
# Configuration parameters: EnforcedStyle, SupportedStyles.
308-
# SupportedStyles: compact, exploded
309-
Style/RaiseArgs:
310-
Exclude:
311-
- 'lib/chewy.rb'
312-
- 'lib/chewy/query.rb'
313-
- 'lib/chewy/strategy/base.rb'
314-
- 'lib/chewy/type/import.rb'
315-
316-
# Offense count: 2
317-
# Cop supports --auto-correct.
318-
Style/RedundantSelf:
319-
Exclude:
320-
- 'lib/chewy/config.rb'
321-
- 'lib/chewy/repository.rb'
322-
323-
# Offense count: 1
324-
# Cop supports --auto-correct.
325-
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
326-
# SupportedStyles: slashes, percent_r, mixed
327-
Style/RegexpLiteral:
328-
Exclude:
329-
- 'spec/chewy_spec.rb'
330-
331-
# Offense count: 1
332-
# Cop supports --auto-correct.
333-
Style/RescueModifier:
334-
Exclude:
335-
- 'spec/chewy/type/import_spec.rb'
336-
337-
# Offense count: 35
338-
# Cop supports --auto-correct.
339-
# Configuration parameters: AllowAsExpressionSeparator.
340-
Style/Semicolon:
341-
Exclude:
342-
- 'spec/chewy/query/criteria_spec.rb'
343-
- 'spec/chewy/strategy/atomic_spec.rb'
344-
- 'spec/chewy/type/adapter/active_record_spec.rb'
345-
- 'spec/chewy/type/adapter/mongoid_spec.rb'
346-
- 'spec/chewy/type/adapter/object_spec.rb'
347-
- 'spec/chewy/type/adapter/sequel_spec.rb'
348-
- 'spec/chewy/type/import_spec.rb'
349-
350-
# Offense count: 4
351-
# Cop supports --auto-correct.
352-
Style/SpaceAfterColon:
353-
Exclude:
354-
- 'spec/chewy/query/pagination/will_paginage_spec.rb'
355-
356-
# Offense count: 6
357-
# Cop supports --auto-correct.
358-
Style/SpaceAfterComma:
359-
Exclude:
360-
- 'lib/chewy/minitest/search_index_receiver.rb'
361-
- 'spec/chewy/minitest/helpers_spec.rb'
362-
- 'spec/chewy/minitest/search_index_receiver_spec.rb'
363-
364-
# Offense count: 1
365-
# Cop supports --auto-correct.
366-
# Configuration parameters: EnforcedStyle, SupportedStyles.
367-
# SupportedStyles: space, no_space
368-
Style/SpaceAroundEqualsInParameterDefault:
369-
Exclude:
370-
- 'lib/chewy/query/pagination/will_paginate.rb'
371-
372-
# Offense count: 21
373-
# Cop supports --auto-correct.
374-
# Configuration parameters: AllowForAlignment.
375-
Style/SpaceAroundOperators:
376-
Exclude:
377-
- 'lib/chewy/runtime/version.rb'
378-
- 'spec/chewy/fields/base_spec.rb'
379-
- 'spec/chewy/query_spec.rb'
380-
- 'spec/chewy/search_spec.rb'
381-
- 'spec/chewy/type/adapter/active_record_spec.rb'
382-
- 'spec/chewy/type/adapter/mongoid_spec.rb'
383-
- 'spec/chewy/type/adapter/sequel_spec.rb'
384-
- 'spec/chewy/type/import_spec.rb'
385-
386-
# Offense count: 1
387-
# Cop supports --auto-correct.
388-
Style/SpaceBeforeComment:
389-
Exclude:
390-
- 'spec/support/sequel.rb'
391-
392-
# Offense count: 14
393-
# Cop supports --auto-correct.
394-
Style/SpaceInsideBrackets:
395-
Exclude:
396-
- 'lib/chewy/rake_helper.rb'
397-
- 'spec/chewy/query/criteria_spec.rb'
398-
- 'spec/chewy/query_spec.rb'
399-
400-
# Offense count: 24
401-
# Cop supports --auto-correct.
402-
Style/SpaceInsideParens:
403-
Exclude:
404-
- 'spec/chewy/type/adapter/sequel_spec.rb'
405-
406-
# Offense count: 1
407-
# Cop supports --auto-correct.
408-
# Configuration parameters: EnforcedStyle, SupportedStyles.
409-
# SupportedStyles: space, no_space
410-
Style/SpaceInsideStringInterpolation:
411-
Exclude:
412-
- 'lib/chewy/rspec/update_index.rb'
413-
414-
# Offense count: 50
415-
# Cop supports --auto-correct.
416-
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
417-
# SupportedStyles: single_quotes, double_quotes
418-
Style/StringLiterals:
419-
Enabled: false
420-
421-
# Offense count: 2
422-
# Cop supports --auto-correct.
423-
# Configuration parameters: EnforcedStyle, SupportedStyles.
424-
# SupportedStyles: final_newline, final_blank_line
425-
Style/TrailingBlankLines:
426-
Exclude:
427-
- 'lib/chewy/rspec.rb'
428-
- 'lib/generators/chewy/install_generator.rb'
429-
430-
# Offense count: 4
431-
# Cop supports --auto-correct.
432-
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
433-
# SupportedStyles: comma, consistent_comma, no_comma
434-
Style/TrailingCommaInArguments:
435-
Exclude:
436-
- 'spec/chewy/fields/time_fields_spec.rb'
437-
- 'spec/chewy/query/filters_spec.rb'
438-
439-
# Offense count: 2
440-
# Cop supports --auto-correct.
441-
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
442-
# SupportedStyles: comma, consistent_comma, no_comma
443-
Style/TrailingCommaInLiteral:
444-
Exclude:
445-
- 'lib/chewy/query/nodes/equal.rb'
446-
- 'lib/chewy/query/nodes/range.rb'
447-
448-
# Offense count: 1
449-
# Cop supports --auto-correct.
450-
Style/WhileUntilDo:
451-
Exclude:
452-
- 'lib/chewy/type/import.rb'

0 commit comments

Comments
 (0)