Commit 69454e36 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Style/RedundantReturn enabled

parent 6ec8ff06
...@@ -480,7 +480,7 @@ Style/RedundantException: ...@@ -480,7 +480,7 @@ Style/RedundantException:
Style/RedundantReturn: Style/RedundantReturn:
Description: "Don't use return where it's not required." Description: "Don't use return where it's not required."
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
Enabled: false Enabled: true
Style/RedundantSelf: Style/RedundantSelf:
Description: "Don't use self where it's not needed." Description: "Don't use self where it's not needed."
......
...@@ -182,7 +182,7 @@ module GitlabMarkdownHelper ...@@ -182,7 +182,7 @@ module GitlabMarkdownHelper
def file_exists?(path) def file_exists?(path)
return false if path.nil? return false if path.nil?
return @repository.blob_at(current_sha, path).present? || @repository.tree(current_sha, path).entries.any? @repository.blob_at(current_sha, path).present? || @repository.tree(current_sha, path).entries.any?
end end
# Check if the path is pointing to a directory(tree) or a file(blob) # Check if the path is pointing to a directory(tree) or a file(blob)
...@@ -190,7 +190,7 @@ module GitlabMarkdownHelper ...@@ -190,7 +190,7 @@ module GitlabMarkdownHelper
def local_path(path) def local_path(path)
return "tree" if @repository.tree(current_sha, path).entries.any? return "tree" if @repository.tree(current_sha, path).entries.any?
return "raw" if @repository.blob_at(current_sha, path).image? return "raw" if @repository.blob_at(current_sha, path).image?
return "blob" "blob"
end end
def current_sha def current_sha
......
...@@ -17,7 +17,7 @@ module MergeRequestsHelper ...@@ -17,7 +17,7 @@ module MergeRequestsHelper
end end
def new_mr_from_push_event(event, target_project) def new_mr_from_push_event(event, target_project)
return { {
merge_request: { merge_request: {
source_project_id: event.project.id, source_project_id: event.project.id,
target_project_id: target_project.id, target_project_id: target_project.id,
......
...@@ -49,7 +49,7 @@ module SubmoduleHelper ...@@ -49,7 +49,7 @@ module SubmoduleHelper
def standard_links(host, namespace, project, commit) def standard_links(host, namespace, project, commit)
base = [ 'https://', host, '/', namespace, '/', project ].join('') base = [ 'https://', host, '/', namespace, '/', project ].join('')
return base, [ base, '/tree/', commit ].join('') [base, [ base, '/tree/', commit ].join('')]
end end
def relative_self_links(url, commit) def relative_self_links(url, commit)
...@@ -58,7 +58,10 @@ module SubmoduleHelper ...@@ -58,7 +58,10 @@ module SubmoduleHelper
else else
base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('') base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('')
end end
return namespace_project_path(base.namespace, base),
[
namespace_project_path(base.namespace, base),
namespace_project_tree_path(base.namespace, base, commit) namespace_project_tree_path(base.namespace, base, commit)
]
end end
end end
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
def self.can_push_to_branch?(user, project, ref) def self.can_push_to_branch?(user, project, ref)
return false unless user return false unless user
if project.protected_branch?(ref) && if project.protected_branch?(ref) &&
!(project.developers_can_push_to_protected_branch?(ref) && project.team.developer?(user)) !(project.developers_can_push_to_protected_branch?(ref) && project.team.developer?(user))
user.can?(:push_code_to_protected_branches, project) user.can?(:push_code_to_protected_branches, project)
...@@ -83,7 +83,7 @@ module Gitlab ...@@ -83,7 +83,7 @@ module Gitlab
end end
end end
return build_status_object(true) build_status_object(true)
end end
def change_access_check(user, project, change) def change_access_check(user, project, change)
......
...@@ -29,7 +29,7 @@ module Gitlab ...@@ -29,7 +29,7 @@ module Gitlab
@cmd_status = wait_thr.value.exitstatus @cmd_status = wait_thr.value.exitstatus
end end
return @cmd_output, @cmd_status [@cmd_output, @cmd_status]
end end
end end
end end
...@@ -19,7 +19,7 @@ module Gitlab ...@@ -19,7 +19,7 @@ module Gitlab
id ||= Gitlab.config.gitlab.default_theme id ||= Gitlab.config.gitlab.default_theme
return themes[id] themes[id]
end end
def self.type_css_class_by_id(id) def self.type_css_class_by_id(id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment