diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-02-08 15:19:53 +0300 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-03-06 18:51:56 +0300 |
commit | 3288e1a874ec0184f9f27f932748e51c57babf17 (patch) | |
tree | 9f8667f5349ecfc59f3c8a6e9641cb1e32fa3d5b /app/services | |
parent | 7bbdb2a29fbc7b8c9f879c42de7063adaa8313c7 (diff) |
Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/application_settings/update_service.rb | 2 | ||||
-rw-r--r-- | app/services/boards/visits/latest_service.rb | 2 | ||||
-rw-r--r-- | app/services/groups/nested_create_service.rb | 2 | ||||
-rw-r--r-- | app/services/projects/download_service.rb | 2 | ||||
-rw-r--r-- | app/services/push_event_payload_service.rb | 2 | ||||
-rw-r--r-- | app/services/upload_service.rb | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb index 2e4643ed668..9146eb96533 100644 --- a/app/services/application_settings/update_service.rb +++ b/app/services/application_settings/update_service.rb @@ -38,7 +38,7 @@ module ApplicationSettings def performance_bar_allowed_group_id performance_bar_enabled = !params.key?(:performance_bar_enabled) || params.delete(:performance_bar_enabled) group_full_path = params.delete(:performance_bar_allowed_group_path) - return nil unless Gitlab::Utils.to_boolean(performance_bar_enabled) + return unless Gitlab::Utils.to_boolean(performance_bar_enabled) Group.find_by_full_path(group_full_path)&.id if group_full_path.present? end diff --git a/app/services/boards/visits/latest_service.rb b/app/services/boards/visits/latest_service.rb index d8de08c5844..d13e25b4f12 100644 --- a/app/services/boards/visits/latest_service.rb +++ b/app/services/boards/visits/latest_service.rb @@ -4,7 +4,7 @@ module Boards module Visits class LatestService < Boards::BaseService def execute - return nil unless current_user + return unless current_user recent_visit_model.latest(current_user, parent, count: params[:count]) end diff --git a/app/services/groups/nested_create_service.rb b/app/services/groups/nested_create_service.rb index f01f5656296..01bd685712b 100644 --- a/app/services/groups/nested_create_service.rb +++ b/app/services/groups/nested_create_service.rb @@ -12,7 +12,7 @@ module Groups end def execute - return nil unless group_path + return unless group_path if namespace = namespace_or_group(group_path) return namespace diff --git a/app/services/projects/download_service.rb b/app/services/projects/download_service.rb index dd297c9ba43..aba175eb79b 100644 --- a/app/services/projects/download_service.rb +++ b/app/services/projects/download_service.rb @@ -11,7 +11,7 @@ module Projects end def execute - return nil unless valid_url?(@url) + return unless valid_url?(@url) uploader = FileUploader.new(@project) uploader.download!(@url) diff --git a/app/services/push_event_payload_service.rb b/app/services/push_event_payload_service.rb index bb1259787af..fe366ac225b 100644 --- a/app/services/push_event_payload_service.rb +++ b/app/services/push_event_payload_service.rb @@ -46,7 +46,7 @@ class PushEventPayloadService def commit_title commit = @push_data.fetch(:commits).last - return nil unless commit && commit[:message] + return unless commit && commit[:message] raw_msg = commit[:message] diff --git a/app/services/upload_service.rb b/app/services/upload_service.rb index 41ca95b3b6f..403944557a2 100644 --- a/app/services/upload_service.rb +++ b/app/services/upload_service.rb @@ -6,7 +6,7 @@ class UploadService end def execute - return nil unless @file && @file.size <= max_attachment_size + return unless @file && @file.size <= max_attachment_size uploader = @uploader_class.new(@model, nil, @uploader_context) uploader.store!(@file) |