Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Newdigate <andrew@gitlab.com>2019-02-08 15:19:53 +0300
committerAndrew Newdigate <andrew@gitlab.com>2019-03-06 18:51:56 +0300
commit3288e1a874ec0184f9f27f932748e51c57babf17 (patch)
tree9f8667f5349ecfc59f3c8a6e9641cb1e32fa3d5b /app/models/project_services
parent7bbdb2a29fbc7b8c9f879c42de7063adaa8313c7 (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/models/project_services')
-rw-r--r--app/models/project_services/campfire_service.rb2
-rw-r--r--app/models/project_services/irker_service.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project_services/campfire_service.rb b/app/models/project_services/campfire_service.rb
index 1d7877a1fb5..ad26e42a21b 100644
--- a/app/models/project_services/campfire_service.rb
+++ b/app/models/project_services/campfire_service.rb
@@ -57,7 +57,7 @@ class CampfireService < Service
# https://github.com/basecamp/campfire-api/blob/master/sections/messages.md#create-message
def speak(room_name, message, auth)
room = rooms(auth).find { |r| r["name"] == room_name }
- return nil unless room
+ return unless room
path = "/room/#{room["id"]}/speak.json"
body = {
diff --git a/app/models/project_services/irker_service.rb b/app/models/project_services/irker_service.rb
index 83fd9a34438..fb76bc89c98 100644
--- a/app/models/project_services/irker_service.rb
+++ b/app/models/project_services/irker_service.rb
@@ -112,7 +112,7 @@ class IrkerService < Service
end
def consider_uri(uri)
- return nil if uri.scheme.nil?
+ return if uri.scheme.nil?
# Authorize both irc://domain.com/#chan and irc://domain.com/chan
if uri.is_a?(URI) && uri.scheme[/^ircs?\z/] && !uri.path.nil?