Skip to content

Commit befb513

Browse files
committed
Fix offenses exposed by RuboCop 1.87 and keep ~> 1.80 version pin
1 parent 79db808 commit befb513

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

.rubocop_todo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
3-
# using RuboCop version 1.80.2.
3+
# using RuboCop version 1.87.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
@@ -161,7 +161,7 @@ Naming/MethodParameterName:
161161
# Offense count: 2
162162
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
163163
# AllowedMethods: call
164-
# WaywardPredicates: nonzero?
164+
# WaywardPredicates: infinite?, nonzero?
165165
Naming/PredicateMethod:
166166
Exclude:
167167
- 'lib/xeroizer/models/invoice.rb'
@@ -345,7 +345,7 @@ Style/ZeroLengthPredicate:
345345

346346
# Offense count: 23
347347
# This cop supports safe autocorrection (--autocorrect).
348-
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
348+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
349349
# URISchemes: http, https
350350
Layout/LineLength:
351351
Max: 380

lib/xeroizer/record/model_definition_helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def define_simple_attribute(field_name, field_type, options, value_if_nil = nil)
6262
self.fields ||= {}
6363

6464
internal_field_name = options[:internal_name] || field_name
65-
self.fields[field_name] = options.merge({
66-
internal_name: internal_field_name,
67-
api_name: options[:api_name] || field_name.to_s.camelize,
68-
type: field_type
69-
})
65+
fields[field_name] = options.merge({
66+
internal_name: internal_field_name,
67+
api_name: options[:api_name] || field_name.to_s.camelize,
68+
type: field_type
69+
})
7070
define_method internal_field_name do
7171
@attributes[field_name].nil? ? value_if_nil : @attributes[field_name]
7272
end

lib/xeroizer/record/validation_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def validates_with_validator(validator, args)
1919

2020
self.validators ||= []
2121
args.flatten.each do |attribute|
22-
self.validators << validator.new(attribute, options)
22+
validators << validator.new(attribute, options)
2323
end
2424
end
2525

test/integration/bank_transaction_reference_data.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ def new_bank_transaction
1616
type: 'SPEND',
1717
contact: { name: 'Jazz Kang' },
1818
line_items: [
19-
description: 'Bike shorts made of clear, unbreathable material',
20-
quantity: 1,
21-
unit_amount: 39.99,
22-
account_code: account.code,
23-
tax_type: account.tax_type
19+
{
20+
description: 'Bike shorts made of clear, unbreathable material',
21+
quantity: 1,
22+
unit_amount: 39.99,
23+
account_code: account.code,
24+
tax_type: account.tax_type
25+
}
2426
],
2527
bank_account: { account_id: bank_account.account_id },
2628
reference: 'BTF323'

0 commit comments

Comments
 (0)