diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-02-08 14:19:53 +0200 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-03-06 17:51:56 +0200 |
commit | 3288e1a874ec0184f9f27f932748e51c57babf17 (patch) | |
tree | 9f8667f5349ecfc59f3c8a6e9641cb1e32fa3d5b /app/helpers/merge_requests_helper.rb | |
parent | 7bbdb2a29fbc7b8c9f879c42de7063adaa8313c7 (diff) | |
download | gitlab-ce-3288e1a874ec0184f9f27f932748e51c57babf17.tar.gz |
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/helpers/merge_requests_helper.rb')
-rw-r--r-- | app/helpers/merge_requests_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 23d7aa427bb..991ca42c445 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -29,7 +29,7 @@ module MergeRequestsHelper def ci_build_details_path(merge_request) build_url = merge_request.source_project.ci_service.build_page(merge_request.diff_head_sha, merge_request.source_branch) - return nil unless build_url + return unless build_url parsed_url = URI.parse(build_url) @@ -92,7 +92,7 @@ module MergeRequestsHelper end def version_index(merge_request_diff) - return nil if @merge_request_diffs.empty? + return if @merge_request_diffs.empty? @merge_request_diffs.size - @merge_request_diffs.index(merge_request_diff) end @@ -149,7 +149,7 @@ module MergeRequestsHelper def merge_request_source_project_for_project(project = @project) unless can?(current_user, :create_merge_request_in, project) - return nil + return end if can?(current_user, :create_merge_request_from, project) |