Enable Style/IdenticalConditionalBranches Rubocop cop
This commit is contained in:
parent
2c650b6f30
commit
c6f9a1c273
|
@ -284,7 +284,7 @@ Style/IfWithSemicolon:
|
|||
# Checks that conditional statements do not have an identical line at the
|
||||
# end of each branch, which can validly be moved out of the conditional.
|
||||
Style/IdenticalConditionalBranches:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
# Checks the indentation of the first line of the right-hand-side of a
|
||||
# multi-line assignment.
|
||||
|
|
|
@ -53,11 +53,11 @@ class ProjectsController < Projects::ApplicationController
|
|||
notice: "Project '#{@project.name}' was successfully updated."
|
||||
)
|
||||
end
|
||||
format.js
|
||||
else
|
||||
format.html { render 'edit' }
|
||||
format.js
|
||||
end
|
||||
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -114,13 +114,13 @@ class IrkerService < Service
|
|||
if uri.is_a?(URI) && uri.scheme[/^ircs?\z/] && !uri.path.nil?
|
||||
# Do not authorize irc://domain.com/
|
||||
if uri.fragment.nil? && uri.path.length > 1
|
||||
uri.to_s
|
||||
else
|
||||
# Authorize irc://domain.com/smthg#chan
|
||||
# The irker daemon will deal with it by concatenating smthg and
|
||||
# chan, thus sending messages on #smthgchan
|
||||
uri.to_s
|
||||
end
|
||||
|
||||
uri.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -61,19 +61,14 @@ module MergeRequests
|
|||
merge_requests.each do |merge_request|
|
||||
if merge_request.source_branch == @branch_name || force_push?
|
||||
merge_request.reload_diff
|
||||
merge_request.mark_as_unchecked
|
||||
else
|
||||
mr_commit_ids = merge_request.commits.map(&:id)
|
||||
push_commit_ids = @commits.map(&:id)
|
||||
matches = mr_commit_ids & push_commit_ids
|
||||
|
||||
if matches.any?
|
||||
merge_request.reload_diff
|
||||
merge_request.mark_as_unchecked
|
||||
else
|
||||
merge_request.mark_as_unchecked
|
||||
end
|
||||
merge_request.reload_diff if matches.any?
|
||||
end
|
||||
|
||||
merge_request.mark_as_unchecked
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -143,18 +143,14 @@ module Rouge
|
|||
'</span>'
|
||||
end
|
||||
end
|
||||
lines.join("\n")
|
||||
else
|
||||
if @linenos == 'inline'
|
||||
lines = lines.each_with_index.map do |line, index|
|
||||
number = index + @linenostart
|
||||
"<span class=\"linenos\">#{number}</span>#{line}"
|
||||
end
|
||||
lines.join("\n")
|
||||
else
|
||||
lines.join("\n")
|
||||
elsif @linenos == 'inline'
|
||||
lines = lines.each_with_index.map do |line, index|
|
||||
number = index + @linenostart
|
||||
"<span class=\"linenos\">#{number}</span>#{line}"
|
||||
end
|
||||
end
|
||||
|
||||
lines.join("\n")
|
||||
end
|
||||
|
||||
def span(tok, val)
|
||||
|
|
Loading…
Reference in New Issue