Commit cc0ea13d authored by Robert Speicher's avatar Robert Speicher

Merge branch 'rubocop/enable-ambiguous-operator-rubocop-lint' into 'master'

Enable Lint/AmbiguousOperator rubocop cop

Enforce using parentheses if ambiguous operators are detected, like `header *some_method` or `array.select &:even?`.

See #17478

See merge request !4454
parents 90a3c947 080997d8
......@@ -771,7 +771,7 @@ Metrics/PerceivedComplexity:
# Checks for ambiguous operators in the first argument of a method invocation
# without parentheses.
Lint/AmbiguousOperator:
Enabled: false
Enabled: true
# Checks for ambiguous regexp literals in the first argument of a method
# invocation without parentheses.
......
......@@ -83,7 +83,7 @@ class IrkerService < Service
self.channels = recipients.split(/\s+/).map do |recipient|
format_channel(recipient)
end
channels.reject! &:nil?
channels.reject!(&:nil?)
end
def format_channel(recipient)
......
......@@ -57,7 +57,7 @@ module API
not_found! "File" unless blob
content_type 'text/plain'
header *Gitlab::Workhorse.send_git_blob(repo, blob)
header(*Gitlab::Workhorse.send_git_blob(repo, blob))
end
# Get a raw blob contents by blob sha
......@@ -83,7 +83,7 @@ module API
env['api.format'] = :txt
content_type blob.mime_type
header *Gitlab::Workhorse.send_git_blob(repo, blob)
header(*Gitlab::Workhorse.send_git_blob(repo, blob))
end
# Get a an archive of the repository
......@@ -98,7 +98,7 @@ module API
authorize! :download_code, user_project
begin
header *Gitlab::Workhorse.send_git_archive(user_project, params[:sha], params[:format])
header(*Gitlab::Workhorse.send_git_archive(user_project, params[:sha], params[:format]))
rescue
not_found!('File')
end
......
......@@ -17,9 +17,9 @@ module Gitlab
file.rewind
cmd = []
cmd.push *%W(ssh-keygen)
cmd.push *%W(-E md5) if explicit_fingerprint_algorithm?
cmd.push *%W(-lf #{file.path})
cmd.push('ssh-keygen')
cmd.push('-E', 'md5') if explicit_fingerprint_algorithm?
cmd.push('-lf', file.path)
cmd_output, cmd_status = popen(cmd, '/tmp')
end
......
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