Commit c370dce0 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Enable Style/RedundantParentheses rubocop cop

See #17478
parent 43c35b0f
...@@ -486,10 +486,9 @@ Style/RedundantException: ...@@ -486,10 +486,9 @@ Style/RedundantException:
Style/RedundantFreeze: Style/RedundantFreeze:
Enabled: false Enabled: false
# TODO: Enable RedundantParentheses Cop.
# Checks for parentheses that seem not to serve any purpose. # Checks for parentheses that seem not to serve any purpose.
Style/RedundantParentheses: Style/RedundantParentheses:
Enabled: false Enabled: true
# Don't use return where it's not required. # Don't use return where it's not required.
Style/RedundantReturn: Style/RedundantReturn:
......
...@@ -39,11 +39,11 @@ module DiffHelper ...@@ -39,11 +39,11 @@ module DiffHelper
end end
def unfold_bottom_class(bottom) def unfold_bottom_class(bottom)
(bottom) ? 'js-unfold-bottom' : '' bottom ? 'js-unfold-bottom' : ''
end end
def unfold_class(unfold) def unfold_class(unfold)
(unfold) ? 'unfold js-unfold' : '' unfold ? 'unfold js-unfold' : ''
end end
def diff_line_content(line, line_type = nil) def diff_line_content(line, line_type = nil)
......
...@@ -23,6 +23,6 @@ else ...@@ -23,6 +23,6 @@ else
secure: Gitlab.config.gitlab.https, secure: Gitlab.config.gitlab.https,
httponly: true, httponly: true,
expires_in: Settings.gitlab['session_expire_delay'] * 60, expires_in: Settings.gitlab['session_expire_delay'] * 60,
path: (Rails.application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root path: Rails.application.config.relative_url_root.nil? ? '/' : Gitlab::Application.config.relative_url_root
) )
end end
...@@ -76,7 +76,7 @@ module API ...@@ -76,7 +76,7 @@ module API
required_attributes! [:email, :password, :name, :username] required_attributes! [:email, :password, :name, :username]
attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :bio, :location, :can_create_group, :admin, :confirm, :external] attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :bio, :location, :can_create_group, :admin, :confirm, :external]
admin = attrs.delete(:admin) admin = attrs.delete(:admin)
confirm = !(attrs.delete(:confirm) =~ (/(false|f|no|0)$/i)) confirm = !(attrs.delete(:confirm) =~ /(false|f|no|0)$/i)
user = User.build_user(attrs) user = User.build_user(attrs)
user.admin = admin unless admin.nil? user.admin = admin unless admin.nil?
user.skip_confirmation! unless confirm user.skip_confirmation! unless confirm
......
...@@ -63,7 +63,7 @@ describe Projects::MergeRequestsController do ...@@ -63,7 +63,7 @@ describe Projects::MergeRequestsController do
id: merge_request.iid, id: merge_request.iid,
format: format) format: format)
expect(response.body).to eq((merge_request.send(:"to_#{format}")).to_s) expect(response.body).to eq(merge_request.send(:"to_#{format}").to_s)
end end
it "should not escape Html" do it "should not escape Html" do
......
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