pactas_itero 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.codeclimate.yml +15 -0
- data/.rubocop.yml +765 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile +2 -0
- data/Rakefile +3 -0
- data/lib/pactas_itero/api/contracts.rb +7 -0
- data/lib/pactas_itero/api/customers.rb +2 -0
- data/lib/pactas_itero/api/invoices.rb +2 -0
- data/lib/pactas_itero/api/oauth.rb +2 -0
- data/lib/pactas_itero/api/orders.rb +2 -0
- data/lib/pactas_itero/api/rated_items.rb +11 -2
- data/lib/pactas_itero/api.rb +2 -0
- data/lib/pactas_itero/client.rb +11 -9
- data/lib/pactas_itero/configurable.rb +8 -6
- data/lib/pactas_itero/default.rb +7 -5
- data/lib/pactas_itero/error.rb +39 -35
- data/lib/pactas_itero/ext/hash/camelize_keys.rb +6 -3
- data/lib/pactas_itero/response/raise_error.rb +3 -1
- data/lib/pactas_itero/version.rb +3 -1
- data/lib/pactas_itero.rb +3 -1
- metadata +11 -83
- data/Gemfile.lock +0 -112
- data/bin/setup +0 -7
- data/pactas_itero.gemspec +0 -37
- data/spec/fixtures/bearer_token.json +0 -5
- data/spec/fixtures/commit_order_response.json +0 -50
- data/spec/fixtures/contract.json +0 -46
- data/spec/fixtures/contract_cancellation_preview_response.json +0 -73
- data/spec/fixtures/contract_changes.json +0 -22
- data/spec/fixtures/contract_termination_response.json +0 -79
- data/spec/fixtures/contracts.json +0 -48
- data/spec/fixtures/create_order_response.json +0 -17
- data/spec/fixtures/create_rated_item.json +0 -8
- data/spec/fixtures/customer.json +0 -23
- data/spec/fixtures/customers.json +0 -40
- data/spec/fixtures/invoice.json +0 -22
- data/spec/fixtures/invoice_download.pdf +0 -0
- data/spec/fixtures/invoices.json +0 -46
- data/spec/fixtures/order.json +0 -15
- data/spec/fixtures/payment_transaction.json +0 -37
- data/spec/fixtures/rated_items.json +0 -12
- data/spec/fixtures/self_service_token.json +0 -6
- data/spec/pactas_itero/api/contracts_spec.rb +0 -193
- data/spec/pactas_itero/api/customers_spec.rb +0 -231
- data/spec/pactas_itero/api/invoices_spec.rb +0 -103
- data/spec/pactas_itero/api/oauth_spec.rb +0 -44
- data/spec/pactas_itero/api/orders_spec.rb +0 -102
- data/spec/pactas_itero/api/payment_transactions_spec.rb +0 -66
- data/spec/pactas_itero/api/rated_items_spec.rb +0 -113
- data/spec/pactas_itero/client_spec.rb +0 -312
- data/spec/pactas_itero_spec.rb +0 -37
- data/spec/spec_helper.rb +0 -100
- data/yarn-error.log +0 -43
data/.rubocop.yml
ADDED
@@ -0,0 +1,765 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rake
|
4
|
+
- rubocop-rspec
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
TargetRubyVersion: 2.6
|
8
|
+
NewCops: enable
|
9
|
+
Exclude:
|
10
|
+
- vendor/**/*
|
11
|
+
- db/schema.rb
|
12
|
+
- bin/*
|
13
|
+
- config/application.rb
|
14
|
+
- config/boot.rb
|
15
|
+
- config/environment.rb
|
16
|
+
|
17
|
+
# rubocop
|
18
|
+
# https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
|
19
|
+
|
20
|
+
# Layout - https://docs.rubocop.org/rubocop/cops_layout.html
|
21
|
+
|
22
|
+
Layout/ConditionPosition:
|
23
|
+
Description: >-
|
24
|
+
Checks for condition placed in a confusing position relative to
|
25
|
+
the keyword.
|
26
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Layout/DotPosition:
|
30
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
31
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
32
|
+
EnforcedStyle: trailing
|
33
|
+
|
34
|
+
Layout/EmptyLineAfterMagicComment:
|
35
|
+
Description: 'Add an empty line after magic comments to separate them from code.'
|
36
|
+
StyleGuide: '#separate-magic-comments-from-code'
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
40
|
+
Description: "Keep blank lines around attribute accessors."
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Layout/ExtraSpacing:
|
44
|
+
Description: 'Do not use unnecessary spacing.'
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
Layout/FirstArrayElementLineBreak:
|
48
|
+
Description: >-
|
49
|
+
Checks for a line break before the first element in a
|
50
|
+
multi-line array.
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
Layout/FirstHashElementLineBreak:
|
54
|
+
Description: >-
|
55
|
+
Checks for a line break before the first element in a
|
56
|
+
multi-line hash.
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Layout/FirstMethodArgumentLineBreak:
|
60
|
+
Description: >-
|
61
|
+
Checks for a line break before the first argument in a
|
62
|
+
multi-line method call.
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Layout/InitialIndentation:
|
66
|
+
Description: >-
|
67
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Layout/LineLength:
|
71
|
+
Description: "Limit lines to 100 characters."
|
72
|
+
Max: 100
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Layout/MultilineMethodCallIndentation:
|
76
|
+
Description: >-
|
77
|
+
Checks indentation of method calls with the dot operator
|
78
|
+
that span more than one line.
|
79
|
+
Enabled: true
|
80
|
+
EnforcedStyle: indented
|
81
|
+
|
82
|
+
Layout/MultilineOperationIndentation:
|
83
|
+
Description: >-
|
84
|
+
Checks indentation of binary operations that span more than
|
85
|
+
one line.
|
86
|
+
Enabled: true
|
87
|
+
EnforcedStyle: indented
|
88
|
+
|
89
|
+
# Layout - https://docs.rubocop.org/rubocop/cops_lint.html
|
90
|
+
|
91
|
+
Lint/AmbiguousOperator:
|
92
|
+
Description: >-
|
93
|
+
Checks for ambiguous operators in the first argument of a
|
94
|
+
method invocation without parentheses.
|
95
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
Lint/AmbiguousRegexpLiteral:
|
99
|
+
Description: >-
|
100
|
+
Checks for ambiguous regexp literals in the first argument of
|
101
|
+
a method invocation without parenthesis.
|
102
|
+
Enabled: false
|
103
|
+
|
104
|
+
Lint/AssignmentInCondition:
|
105
|
+
Description: "Don't use assignment in conditions."
|
106
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
Lint/DeprecatedClassMethods:
|
110
|
+
Description: 'Check for deprecated class method calls.'
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
Lint/DuplicateHashKey:
|
114
|
+
Description: 'Check for duplicate keys in hash literals.'
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
Lint/EachWithObjectArgument:
|
118
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
119
|
+
Enabled: false
|
120
|
+
|
121
|
+
Lint/ElseLayout:
|
122
|
+
Description: 'Check for odd code arrangement in an else block.'
|
123
|
+
Enabled: false
|
124
|
+
|
125
|
+
Lint/FlipFlop:
|
126
|
+
Description: 'Checks for flip flops'
|
127
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
128
|
+
Enabled: false
|
129
|
+
|
130
|
+
Lint/FormatParameterMismatch:
|
131
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
Lint/LiteralAsCondition:
|
135
|
+
Description: 'Checks of literals used in conditions.'
|
136
|
+
Enabled: false
|
137
|
+
|
138
|
+
Lint/LiteralInInterpolation:
|
139
|
+
Description: 'Checks for literals used in interpolation.'
|
140
|
+
Enabled: false
|
141
|
+
|
142
|
+
Lint/Loop:
|
143
|
+
Description: >-
|
144
|
+
Use Kernel#loop with break rather than begin/end/until or
|
145
|
+
begin/end/while for post-loop tests.
|
146
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
147
|
+
Enabled: false
|
148
|
+
|
149
|
+
Lint/NestedMethodDefinition:
|
150
|
+
Description: 'Do not use nested method definitions.'
|
151
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
152
|
+
Enabled: false
|
153
|
+
|
154
|
+
Lint/NonDeterministicRequireOrder:
|
155
|
+
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
156
|
+
Enabled: true
|
157
|
+
|
158
|
+
Lint/NonLocalExitFromIterator:
|
159
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
160
|
+
Enabled: false
|
161
|
+
|
162
|
+
Lint/ParenthesesAsGroupedExpression:
|
163
|
+
Description: >-
|
164
|
+
Checks for method calls with a space before the opening
|
165
|
+
parenthesis.
|
166
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
167
|
+
Enabled: false
|
168
|
+
|
169
|
+
Lint/RaiseException:
|
170
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
171
|
+
Enabled: true
|
172
|
+
|
173
|
+
Lint/RedundantCopDisableDirective:
|
174
|
+
Description: >-
|
175
|
+
Checks for rubocop:disable comments that can be removed.
|
176
|
+
Note: this cop is not disabled when disabling all cops.
|
177
|
+
It must be explicitly disabled.
|
178
|
+
Enabled: false
|
179
|
+
|
180
|
+
Lint/RequireParentheses:
|
181
|
+
Description: >-
|
182
|
+
Use parentheses in the method call to avoid confusion
|
183
|
+
about precedence.
|
184
|
+
Enabled: false
|
185
|
+
|
186
|
+
Lint/SuppressedException:
|
187
|
+
Description: "Don't suppress exception."
|
188
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
189
|
+
Enabled: false
|
190
|
+
|
191
|
+
Lint/UnderscorePrefixedVariableName:
|
192
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
193
|
+
Enabled: false
|
194
|
+
|
195
|
+
Lint/Void:
|
196
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
197
|
+
Enabled: false
|
198
|
+
|
199
|
+
# Metrics - https://docs.rubocop.org/rubocop/cops_metrics.html
|
200
|
+
|
201
|
+
Metrics/AbcSize:
|
202
|
+
Description: >-
|
203
|
+
A calculated magnitude based on number of assignments,
|
204
|
+
branches, and conditions.
|
205
|
+
Enabled: false
|
206
|
+
|
207
|
+
Metrics/BlockLength:
|
208
|
+
Description: 'Avoid long blocks with many lines.'
|
209
|
+
Enabled: true
|
210
|
+
IgnoredMethods: [task, namespace, describe, context, factory, it]
|
211
|
+
Exclude:
|
212
|
+
- !ruby/regexp /config/routes.rb$/
|
213
|
+
|
214
|
+
Metrics/BlockNesting:
|
215
|
+
Description: 'Avoid excessive block nesting'
|
216
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
217
|
+
Enabled: false
|
218
|
+
|
219
|
+
Metrics/ClassLength:
|
220
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
221
|
+
Enabled: false
|
222
|
+
|
223
|
+
Metrics/CyclomaticComplexity:
|
224
|
+
Description: >-
|
225
|
+
A complexity metric that is strongly correlated to the number
|
226
|
+
of test cases needed to validate a method.
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
Metrics/MethodLength:
|
230
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
231
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
232
|
+
Enabled: false
|
233
|
+
|
234
|
+
Metrics/ModuleLength:
|
235
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
236
|
+
Enabled: false
|
237
|
+
|
238
|
+
Metrics/ParameterLists:
|
239
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
240
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
241
|
+
Enabled: false
|
242
|
+
|
243
|
+
# Naming - https://docs.rubocop.org/rubocop/cops_naming.html
|
244
|
+
|
245
|
+
Naming/AccessorMethodName:
|
246
|
+
Description: Check the naming of accessor methods for get_/set_.
|
247
|
+
Enabled: false
|
248
|
+
|
249
|
+
Naming/AsciiIdentifiers:
|
250
|
+
Description: 'Use only ascii symbols in identifiers.'
|
251
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
252
|
+
Enabled: false
|
253
|
+
|
254
|
+
Naming/BinaryOperatorParameterName:
|
255
|
+
Description: 'When defining binary operators, name the argument other.'
|
256
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
257
|
+
Enabled: false
|
258
|
+
|
259
|
+
Naming/FileName:
|
260
|
+
Description: 'Use snake_case for source file names.'
|
261
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
262
|
+
Enabled: false
|
263
|
+
|
264
|
+
Naming/MemoizedInstanceVariableName:
|
265
|
+
Description: Memoized method name should match memo instance variable name.
|
266
|
+
Enabled: true
|
267
|
+
EnforcedStyleForLeadingUnderscores: required
|
268
|
+
|
269
|
+
Naming/PredicateName:
|
270
|
+
Description: 'Check the names of predicate methods.'
|
271
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
272
|
+
NamePrefix:
|
273
|
+
- is_
|
274
|
+
- has_
|
275
|
+
- have_
|
276
|
+
ForbiddenPrefixes:
|
277
|
+
- is_
|
278
|
+
Exclude:
|
279
|
+
- !ruby/regexp /spec(\/.*)*\/.*\.rb$/
|
280
|
+
|
281
|
+
Naming/RescuedExceptionsVariableName:
|
282
|
+
Description: 'Use consistent rescued exceptions variables naming.'
|
283
|
+
Enabled: true
|
284
|
+
PreferredName: error
|
285
|
+
|
286
|
+
# Style - https://docs.rubocop.org/rubocop/cops_style.html
|
287
|
+
|
288
|
+
Style/AccessorGrouping:
|
289
|
+
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
290
|
+
Enabled: true
|
291
|
+
|
292
|
+
Style/Alias:
|
293
|
+
Description: 'Use alias_method instead of alias.'
|
294
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
295
|
+
Enabled: false
|
296
|
+
|
297
|
+
Style/ArrayCoercion:
|
298
|
+
Description: >-
|
299
|
+
Use Array() instead of explicit Array check or [*var], when dealing
|
300
|
+
with a variable you want to treat as an Array, but you're not certain it's an array.
|
301
|
+
Enabled: true
|
302
|
+
|
303
|
+
Style/ArrayJoin:
|
304
|
+
Description: 'Use Array#join instead of Array#*.'
|
305
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
306
|
+
Enabled: false
|
307
|
+
|
308
|
+
Style/AsciiComments:
|
309
|
+
Description: 'Use only ascii symbols in comments.'
|
310
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
311
|
+
Enabled: false
|
312
|
+
|
313
|
+
Style/Attr:
|
314
|
+
Description: 'Checks for uses of Module#attr.'
|
315
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
316
|
+
Enabled: false
|
317
|
+
|
318
|
+
Style/CaseEquality:
|
319
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
320
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
321
|
+
Enabled: false
|
322
|
+
|
323
|
+
Style/CaseLikeIf:
|
324
|
+
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
325
|
+
Enabled: true
|
326
|
+
|
327
|
+
Style/CharacterLiteral:
|
328
|
+
Description: 'Checks for uses of character literals.'
|
329
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
330
|
+
Enabled: false
|
331
|
+
|
332
|
+
Style/ClassAndModuleChildren:
|
333
|
+
Description: 'Checks style of children classes and modules.'
|
334
|
+
Enabled: true
|
335
|
+
EnforcedStyle: nested
|
336
|
+
|
337
|
+
Style/ClassVars:
|
338
|
+
Description: 'Avoid the use of class variables.'
|
339
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
340
|
+
Enabled: false
|
341
|
+
|
342
|
+
Style/CollectionMethods:
|
343
|
+
Enabled: true
|
344
|
+
PreferredMethods:
|
345
|
+
find: detect
|
346
|
+
reduce: inject
|
347
|
+
collect: map
|
348
|
+
collect!: map!
|
349
|
+
find_all: select
|
350
|
+
|
351
|
+
Style/ColonMethodCall:
|
352
|
+
Description: 'Do not use :: for method call.'
|
353
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
354
|
+
Enabled: false
|
355
|
+
|
356
|
+
Style/CommentAnnotation:
|
357
|
+
Description: >-
|
358
|
+
Checks formatting of special comments
|
359
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
360
|
+
Enabled: false
|
361
|
+
|
362
|
+
Style/Documentation:
|
363
|
+
Description: 'Document classes and non-namespace modules.'
|
364
|
+
Enabled: false
|
365
|
+
|
366
|
+
Style/DoubleNegation:
|
367
|
+
Description: 'Checks for uses of double negation (!!).'
|
368
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
369
|
+
Enabled: false
|
370
|
+
|
371
|
+
Style/EachWithObject:
|
372
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
373
|
+
Enabled: false
|
374
|
+
|
375
|
+
Style/EmptyLiteral:
|
376
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
377
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
378
|
+
Enabled: false
|
379
|
+
|
380
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
381
|
+
# AutoCorrectEncodingComment must match the regex
|
382
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
383
|
+
Style/Encoding:
|
384
|
+
Enabled: false
|
385
|
+
|
386
|
+
Style/EvenOdd:
|
387
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
388
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
389
|
+
Enabled: false
|
390
|
+
|
391
|
+
Style/FormatString:
|
392
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
393
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
394
|
+
Enabled: false
|
395
|
+
|
396
|
+
Style/GlobalVars:
|
397
|
+
Description: 'Do not introduce global variables.'
|
398
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
399
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
400
|
+
Enabled: false
|
401
|
+
|
402
|
+
Style/GuardClause:
|
403
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
404
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
405
|
+
Enabled: false
|
406
|
+
|
407
|
+
Style/HashAsLastArrayItem:
|
408
|
+
Description: >-
|
409
|
+
Checks for presence or absence of braces around hash literal as a last
|
410
|
+
array item depending on configuration.
|
411
|
+
Enabled: true
|
412
|
+
|
413
|
+
Style/HashEachMethods:
|
414
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
415
|
+
Enabled: false
|
416
|
+
|
417
|
+
Style/HashLikeCase:
|
418
|
+
Description: >-
|
419
|
+
Checks for places where `case-when` represents a simple 1:1
|
420
|
+
mapping and can be replaced with a hash lookup.
|
421
|
+
Enabled: true
|
422
|
+
|
423
|
+
Style/HashTransformKeys:
|
424
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
425
|
+
Enabled: false
|
426
|
+
|
427
|
+
Style/HashTransformValues:
|
428
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
429
|
+
Enabled: false
|
430
|
+
|
431
|
+
Style/IfUnlessModifier:
|
432
|
+
Description: >-
|
433
|
+
Favor modifier if/unless usage when you have a
|
434
|
+
single-line body.
|
435
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
436
|
+
Enabled: false
|
437
|
+
|
438
|
+
Style/IfWithSemicolon:
|
439
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
440
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
441
|
+
Enabled: false
|
442
|
+
|
443
|
+
Style/IpAddresses:
|
444
|
+
Description: "Don't include literal IP addresses in code."
|
445
|
+
Enabled: true
|
446
|
+
Exclude:
|
447
|
+
- !ruby/regexp /spec(\/.*)*\/.*\.rb$/
|
448
|
+
|
449
|
+
Style/Lambda:
|
450
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
451
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
452
|
+
Enabled: false
|
453
|
+
|
454
|
+
Style/LambdaCall:
|
455
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
456
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
457
|
+
Enabled: false
|
458
|
+
|
459
|
+
Style/LineEndConcatenation:
|
460
|
+
Description: >-
|
461
|
+
Use \ instead of + or << to concatenate two string literals at
|
462
|
+
line end.
|
463
|
+
Enabled: false
|
464
|
+
|
465
|
+
Style/ModuleFunction:
|
466
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
467
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
468
|
+
Enabled: false
|
469
|
+
|
470
|
+
Style/MultilineBlockChain:
|
471
|
+
Description: 'Avoid multi-line chains of blocks.'
|
472
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
473
|
+
Enabled: false
|
474
|
+
|
475
|
+
Style/NegatedIf:
|
476
|
+
Description: >-
|
477
|
+
Favor unless over if for negative conditions
|
478
|
+
(or control flow or).
|
479
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
480
|
+
Enabled: false
|
481
|
+
|
482
|
+
Style/NegatedWhile:
|
483
|
+
Description: 'Favor until over while for negative conditions.'
|
484
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
485
|
+
Enabled: false
|
486
|
+
|
487
|
+
Style/Next:
|
488
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
489
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
490
|
+
Enabled: false
|
491
|
+
|
492
|
+
Style/NilComparison:
|
493
|
+
Description: 'Prefer x.nil? to x == nil.'
|
494
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
495
|
+
Enabled: false
|
496
|
+
|
497
|
+
Style/Not:
|
498
|
+
Description: 'Use ! instead of not.'
|
499
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
500
|
+
Enabled: false
|
501
|
+
|
502
|
+
Style/NumericLiterals:
|
503
|
+
Description: >-
|
504
|
+
Add underscores to large numeric literals to improve their
|
505
|
+
readability.
|
506
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
507
|
+
Enabled: false
|
508
|
+
|
509
|
+
Style/OneLineConditional:
|
510
|
+
Description: >-
|
511
|
+
Favor the ternary operator(?:) over
|
512
|
+
if/then/else/end constructs.
|
513
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
514
|
+
Enabled: false
|
515
|
+
|
516
|
+
Style/PercentLiteralDelimiters:
|
517
|
+
Description: 'Use `%`-literal delimiters consistently'
|
518
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
519
|
+
Enabled: false
|
520
|
+
|
521
|
+
Style/PerlBackrefs:
|
522
|
+
Description: 'Avoid Perl-style regex back references.'
|
523
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
524
|
+
Enabled: false
|
525
|
+
|
526
|
+
Style/PreferredHashMethods:
|
527
|
+
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
528
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
529
|
+
Enabled: false
|
530
|
+
|
531
|
+
Style/Proc:
|
532
|
+
Description: 'Use proc instead of Proc.new.'
|
533
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
534
|
+
Enabled: false
|
535
|
+
|
536
|
+
Style/RaiseArgs:
|
537
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
538
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
539
|
+
Enabled: false
|
540
|
+
|
541
|
+
Style/RedundantFetchBlock:
|
542
|
+
Description: >-
|
543
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
544
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
545
|
+
Enabled: true
|
546
|
+
|
547
|
+
Style/RegexpLiteral:
|
548
|
+
Description: 'Use / or %r around regular expressions.'
|
549
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
550
|
+
Enabled: false
|
551
|
+
|
552
|
+
Style/Sample:
|
553
|
+
Description: >-
|
554
|
+
Use `sample` instead of `shuffle.first`,
|
555
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
556
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
557
|
+
Enabled: false
|
558
|
+
|
559
|
+
Style/SelfAssignment:
|
560
|
+
Description: >-
|
561
|
+
Checks for places where self-assignment shorthand should have
|
562
|
+
been used.
|
563
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
564
|
+
Enabled: false
|
565
|
+
|
566
|
+
Style/SignalException:
|
567
|
+
Description: 'Checks for proper usage of fail and raise.'
|
568
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
569
|
+
Enabled: false
|
570
|
+
|
571
|
+
Style/SingleLineBlockParams:
|
572
|
+
Description: 'Enforces the names of some block params.'
|
573
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
574
|
+
Enabled: false
|
575
|
+
|
576
|
+
Style/SingleLineMethods:
|
577
|
+
Description: 'Avoid single-line methods.'
|
578
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
579
|
+
Enabled: false
|
580
|
+
|
581
|
+
Style/SlicingWithRange:
|
582
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
583
|
+
Enabled: true
|
584
|
+
|
585
|
+
Style/SpecialGlobalVars:
|
586
|
+
Description: 'Avoid Perl-style global variables.'
|
587
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
588
|
+
Enabled: false
|
589
|
+
|
590
|
+
Style/StringLiterals:
|
591
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
592
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
593
|
+
EnforcedStyle: double_quotes
|
594
|
+
Enabled: true
|
595
|
+
|
596
|
+
Style/SymbolArray:
|
597
|
+
Enabled: false
|
598
|
+
|
599
|
+
Style/TrailingCommaInArguments:
|
600
|
+
Description: 'Checks for trailing comma in argument lists.'
|
601
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
602
|
+
EnforcedStyleForMultiline: comma
|
603
|
+
SupportedStylesForMultiline:
|
604
|
+
- comma
|
605
|
+
- consistent_comma
|
606
|
+
- no_comma
|
607
|
+
Enabled: true
|
608
|
+
|
609
|
+
Style/TrailingCommaInArrayLiteral:
|
610
|
+
Description: 'Checks for trailing comma in array literals.'
|
611
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
612
|
+
EnforcedStyleForMultiline: comma
|
613
|
+
SupportedStylesForMultiline:
|
614
|
+
- comma
|
615
|
+
- consistent_comma
|
616
|
+
- no_comma
|
617
|
+
Enabled: true
|
618
|
+
|
619
|
+
Style/TrailingCommaInHashLiteral:
|
620
|
+
Description: 'Checks for trailing comma in hash literals.'
|
621
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
622
|
+
EnforcedStyleForMultiline: comma
|
623
|
+
SupportedStylesForMultiline:
|
624
|
+
- comma
|
625
|
+
- consistent_comma
|
626
|
+
- no_comma
|
627
|
+
Enabled: true
|
628
|
+
|
629
|
+
Style/TrivialAccessors:
|
630
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
631
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
632
|
+
Enabled: false
|
633
|
+
|
634
|
+
Style/VariableInterpolation:
|
635
|
+
Description: >-
|
636
|
+
Don\'t interpolate global, instance and class variables
|
637
|
+
directly in strings.
|
638
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
639
|
+
Enabled: false
|
640
|
+
|
641
|
+
Style/WhenThen:
|
642
|
+
Description: 'Use when x then ... for one-line cases.'
|
643
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
644
|
+
Enabled: false
|
645
|
+
|
646
|
+
Style/WhileUntilModifier:
|
647
|
+
Description: >-
|
648
|
+
Favor modifier while/until usage when you have a
|
649
|
+
single-line body.
|
650
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
651
|
+
Enabled: false
|
652
|
+
|
653
|
+
Style/WordArray:
|
654
|
+
Description: 'Use %w or %W for arrays of words.'
|
655
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
656
|
+
Enabled: false
|
657
|
+
|
658
|
+
# rubocop-performance
|
659
|
+
# https://github.com/rubocop-hq/rubocop-performance/blob/master/config/default.yml
|
660
|
+
|
661
|
+
# Performance - https://docs.rubocop.org/rubocop-performance/cops_performance.html
|
662
|
+
|
663
|
+
Performance/Count:
|
664
|
+
Description: >-
|
665
|
+
Use `count` instead of `select...size`, `reject...size`,
|
666
|
+
`select...count`, `reject...count`, `select...length`,
|
667
|
+
and `reject...length`.
|
668
|
+
Enabled: false
|
669
|
+
|
670
|
+
Performance/Detect:
|
671
|
+
Description: >-
|
672
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
673
|
+
`select.last`, and `find_all.last`.
|
674
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
675
|
+
Enabled: false
|
676
|
+
|
677
|
+
Performance/FlatMap:
|
678
|
+
Description: >-
|
679
|
+
Use `Enumerable#flat_map`
|
680
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
681
|
+
or `Enumberable#collect..Array#flatten(1)`
|
682
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
683
|
+
Enabled: false
|
684
|
+
|
685
|
+
Performance/ReverseEach:
|
686
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
687
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
688
|
+
Enabled: false
|
689
|
+
|
690
|
+
Performance/Size:
|
691
|
+
Description: >-
|
692
|
+
Use `size` instead of `count` for counting
|
693
|
+
the number of elements in `Array` and `Hash`.
|
694
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
695
|
+
Enabled: false
|
696
|
+
|
697
|
+
Performance/StringReplacement:
|
698
|
+
Description: >-
|
699
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
700
|
+
number of characters. Use `delete` instead of `gsub` when
|
701
|
+
you are deleting characters.
|
702
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
703
|
+
Enabled: false
|
704
|
+
|
705
|
+
Performance/UnfreezeString:
|
706
|
+
Description: 'Use unary plus to get an unfrozen string literal.'
|
707
|
+
Enabled: false
|
708
|
+
|
709
|
+
# rubocop-rspec
|
710
|
+
|
711
|
+
RSpec/ContextWording:
|
712
|
+
Description: Checks that `context` docstring starts with an allowed prefix.
|
713
|
+
Enabled: false
|
714
|
+
|
715
|
+
RSpec/DescribeClass:
|
716
|
+
Enabled: true
|
717
|
+
Description: Check that the first argument to the top level describe is a constant.
|
718
|
+
Exclude:
|
719
|
+
- !ruby/regexp /spec\/config(\/.*)*\/.*\.rb$/
|
720
|
+
- !ruby/regexp /spec\/features(\/.*)*\/.*\.rb$/
|
721
|
+
- !ruby/regexp /spec\/lib\/tasks(\/.*)*\/.*\.rb$/
|
722
|
+
- !ruby/regexp /spec\/requests(\/.*)*\/.*\.rb$/
|
723
|
+
- !ruby/regexp /spec\/routing(\/.*)*\/.*\.rb$/
|
724
|
+
- !ruby/regexp /spec\/views(\/.*)*\/.*\.rb$/
|
725
|
+
|
726
|
+
RSpec/ExampleLength:
|
727
|
+
Description: Checks for long examples.
|
728
|
+
Enabled: false
|
729
|
+
|
730
|
+
RSpec/ExampleWithoutDescription:
|
731
|
+
Description: Checks for examples without a description.
|
732
|
+
Enabled: false
|
733
|
+
|
734
|
+
RSpec/HookArgument:
|
735
|
+
Description: Omit the default :each argument for RSpec hooks.
|
736
|
+
Enabled: false
|
737
|
+
|
738
|
+
RSpec/MultipleExpectations:
|
739
|
+
Description: Checks if examples contain too many `expect` calls.
|
740
|
+
Enabled: false
|
741
|
+
|
742
|
+
RSpec/NamedSubject:
|
743
|
+
Enabled: true
|
744
|
+
IgnoreSharedExamples: false
|
745
|
+
Description: Checks for explicitly referenced test subjects.
|
746
|
+
|
747
|
+
RSpec/NestedGroups:
|
748
|
+
Enabled: true
|
749
|
+
Description: Checks for nested example groups.
|
750
|
+
Max: 4
|
751
|
+
|
752
|
+
RSpec/VerifiedDoubles:
|
753
|
+
Enabled: true
|
754
|
+
Description: Prefer using verifying doubles over normal doubles.
|
755
|
+
IgnoreSymbolicNames: true
|
756
|
+
|
757
|
+
# Capybara - https://docs.rubocop.org/rubocop-rspec/cops_capybara.html
|
758
|
+
|
759
|
+
RSpec/Capybara/FeatureMethods:
|
760
|
+
Description: Checks for consistent method usage in feature specs.
|
761
|
+
Enabled: false
|
762
|
+
|
763
|
+
RSpec/InstanceVariable:
|
764
|
+
Description: Checks for instance variable usage in specs.
|
765
|
+
Enabled: false
|