From 57d8a59d10e2ec18e3f266bf09a9ea67380ee335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 9 Aug 2021 17:32:45 +0200 Subject: [PATCH] Add an apply Style/RaiseArgs rubocop rule We were already applying it most of the time. --- .rubocop.yml | 3 +++ app/controllers/management/base_controller.rb | 2 +- app/controllers/users/omniauth_callbacks_controller.rb | 2 +- app/controllers/valuation/budget_investments_controller.rb | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8c19663df..42ebe443e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -449,6 +449,9 @@ Style/PercentLiteralDelimiters: Style/Proc: Enabled: true +Style/RaiseArgs: + Enabled: true + Style/RedundantFileExtensionInRequire: Enabled: true diff --git a/app/controllers/management/base_controller.rb b/app/controllers/management/base_controller.rb index 5bba8fcad..f9e88ed55 100644 --- a/app/controllers/management/base_controller.rb +++ b/app/controllers/management/base_controller.rb @@ -13,7 +13,7 @@ class Management::BaseController < ActionController::Base private def verify_manager - raise ActionController::RoutingError.new("Not Found") if current_manager.blank? + raise ActionController::RoutingError, "Not Found" if current_manager.blank? end def current_manager diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index f5b5350b8..02186e9e9 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -26,7 +26,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController private def sign_in_with(feature, provider) - raise ActionController::RoutingError.new("Not Found") unless Setting["feature.#{feature}"] + raise ActionController::RoutingError, "Not Found" unless Setting["feature.#{feature}"] auth = request.env["omniauth.auth"] diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index e9cd4f21e..475b91b68 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -105,7 +105,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController def restrict_access unless current_user.administrator? || current_budget.valuating? - raise CanCan::AccessDenied.new(I18n.t("valuation.budget_investments.not_in_valuating_phase")) + raise CanCan::AccessDenied, I18n.t("valuation.budget_investments.not_in_valuating_phase") end end @@ -114,7 +114,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController Budget::ValuatorAssignment.exists?(investment_id: params[:id], valuator_id: current_user.valuator.id) - raise ActionController::RoutingError.new("Not Found") + raise ActionController::RoutingError, "Not Found" end def valid_price_params?