mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Auto correct Rubocop's Layout/EmptyLinesAroundExceptionHandlingKeywords cop
This commit is contained in:
@@ -336,18 +336,6 @@ Layout/EmptyLinesAroundClassBody:
|
||||
- 'lib/open_food_network/rack_request_blocker.rb'
|
||||
- 'lib/open_food_network/reports/bulk_coop_report.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
||||
Exclude:
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/enterprises_controller.rb'
|
||||
- 'app/controllers/shop_controller.rb'
|
||||
- 'app/models/spree/adjustment_decorator.rb'
|
||||
- 'app/models/spree/tax_rate_decorator.rb'
|
||||
- 'lib/tasks/users.rake'
|
||||
- 'spec/features/admin/overview_spec.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLinesAroundMethodBody:
|
||||
|
||||
@@ -133,7 +133,6 @@ class CheckoutController < Spree::CheckoutController
|
||||
def advance_order_state(order)
|
||||
tries ||= 3
|
||||
order.next
|
||||
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
retry unless (tries -= 1).zero?
|
||||
false
|
||||
|
||||
@@ -33,7 +33,6 @@ class EnterprisesController < BaseController
|
||||
begin
|
||||
Rails.application.routes.recognize_path( "/#{ params[:permalink].to_s }" )
|
||||
render text: params[:permalink], status: 409
|
||||
|
||||
rescue ActionController::RoutingError
|
||||
render text: params[:permalink], status: 200
|
||||
end
|
||||
|
||||
@@ -18,7 +18,6 @@ class ShopController < BaseController
|
||||
products_json = filter(renderer.products_json)
|
||||
|
||||
render json: products_json
|
||||
|
||||
rescue OpenFoodNetwork::CachedProductsRenderer::NoProducts
|
||||
render status: 404, json: ''
|
||||
end
|
||||
|
||||
@@ -72,7 +72,6 @@ module Spree
|
||||
skip_callback :destroy, :after, :update_adjustable
|
||||
|
||||
result = yield
|
||||
|
||||
ensure
|
||||
set_callback :save, :after, :update_adjustable
|
||||
set_callback :destroy, :after, :update_adjustable
|
||||
|
||||
@@ -51,7 +51,6 @@ module Spree
|
||||
calculator.calculable.included_in_price = true
|
||||
|
||||
result = yield
|
||||
|
||||
ensure
|
||||
self.included_in_price = old_included_in_price
|
||||
calculator.calculable.included_in_price = old_included_in_price
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace :openfoodnetwork do
|
||||
ba_country = Spree::Country.find_by_name row[43]
|
||||
ba = Spree::Address.create!({firstname: row[35], lastname: row[36], address1: row[37], address2: row[38], city: row[39], zipcode: row[40], phone: row[41], state: ba_state, country: ba_country, created_at: row[44], updated_at: row[45], company: row[46]}, without_protection: true)
|
||||
user.update_column :bill_address_id, ba.id
|
||||
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
puts "#{row[2]} - #{e.message}"
|
||||
end
|
||||
|
||||
@@ -132,7 +132,6 @@ feature %q{
|
||||
expect(Spree::Dash::Config.configured?).to be true
|
||||
|
||||
block.call
|
||||
|
||||
ensure
|
||||
Spree::Dash::Config.preferred_app_id = nil
|
||||
Spree::Dash::Config.preferred_site_id = nil
|
||||
|
||||
Reference in New Issue
Block a user