From 020dae3d49c683f821c9787e8b1173007b911505 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Mon, 4 Dec 2017 13:05:23 +0530 Subject: [PATCH] Fix Style/ReductantReturn rubocop Exclusions from .rubocop_todo.yml deleted.This cop checks for redundant return expressions. Fixes #1824 --- .rubocop_todo.yml | 10 ---------- app/helpers/application_helper.rb | 4 ++-- app/helpers/format_helper.rb | 8 ++++---- app/helpers/paths_helper.rb | 4 ++-- app/helpers/users_helper.rb | 2 +- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f14cfb99ee..bfd8abd3c9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -646,16 +646,6 @@ Style/RedundantParentheses: Exclude: - 'app/controllers/admin/base_controller.rb' -# Offense count: 9 -# Cop supports --auto-correct. -# Configuration parameters: AllowMultipleReturnValues. -Style/RedundantReturn: - Exclude: - - 'app/helpers/application_helper.rb' - - 'app/helpers/format_helper.rb' - - 'app/helpers/paths_helper.rb' - - 'app/helpers/users_helper.rb' - # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b5e2892e6b..b1e249bae4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,7 +66,7 @@ def tracks(conference) else ts = all.join end - return ts + ts end def difficulty_levels(conference) @@ -80,7 +80,7 @@ def difficulty_levels(conference) else ts = all.join end - return ts + ts end def unread_notifications(user) diff --git a/app/helpers/format_helper.rb b/app/helpers/format_helper.rb index 65578ba690..684e3754e0 100644 --- a/app/helpers/format_helper.rb +++ b/app/helpers/format_helper.rb @@ -101,17 +101,17 @@ def label_for(event_state) def icon_for_todo(bool) if bool - return 'fa fa-check' + 'fa fa-check' else - return 'fa fa-times' + 'fa fa-times' end end def class_for_todo(bool) if bool - return 'todolist-ok' + 'todolist-ok' else - return 'todolist-missing' + 'todolist-missing' end end diff --git a/app/helpers/paths_helper.rb b/app/helpers/paths_helper.rb index df01ab2f98..46e82900dc 100644 --- a/app/helpers/paths_helper.rb +++ b/app/helpers/paths_helper.rb @@ -5,9 +5,9 @@ module PathsHelper def active_nav_li(link) if current_page?(link) - return 'active' + 'active' else - return '' + '' end end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 50becf0c4a..763a44c938 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -18,7 +18,7 @@ def omniauth_configured providers << provider if !ENV["OSEM_#{provider.upcase}_KEY"].blank? && !ENV["OSEM_#{provider.upcase}_SECRET"].blank? end - return providers.uniq + providers.uniq end # Receives a hash, generated from User model, function get_roles