Fixes some rubocop linting offenses - part III

This commit is contained in:
cyrillefr
2025-03-06 23:42:53 +01:00
parent 9ffc249e37
commit 9bb617d748
4 changed files with 5 additions and 23 deletions

View File

@@ -6,12 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLines:
Exclude:
- 'app/services/products_renderer.rb'
# Offense count: 16
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
@@ -28,17 +22,6 @@ Lint/EmptyBlock:
- 'spec/jobs/subscription_placement_job_spec.rb'
- 'spec/models/product_import/entry_validator_spec.rb'
# Offense count: 4
# Configuration parameters: AllowComments.
Lint/EmptyClass:
Exclude:
- 'spec/lib/reports/report_loader_spec.rb'
# Offense count: 1
Lint/FloatComparison:
Exclude:
- 'app/models/spree/gateway/pay_pal_express.rb'
# Offense count: 24
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:

View File

@@ -84,7 +84,7 @@ module Spree
end
def refund(payment, amount)
refund_type = payment.amount == amount.to_f ? "Full" : "Partial"
refund_type = payment.amount == amount.to_d ? "Full" : "Partial"
refund_transaction = provider.build_refund_transaction(
TransactionID: payment.source.transaction_id,
RefundType: refund_type,

View File

@@ -2,7 +2,6 @@
require 'open_food_network/scope_product_to_hub'
class ProductsRenderer
include Pagy::Backend

View File

@@ -5,13 +5,13 @@ require 'spec_helper'
module Reporting
module Reports
module Bananas
class Base; end
class Green; end
class Yellow; end
const_set "Base", Class.new
const_set "Green", Class.new
const_set "Yellow", Class.new
end
module Orange
class OrangeReport; end
const_set "OrangeReport", Class.new
end
end
end