Commit d668b145 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'rubocop/SpaceAroundEqualsInParameterDefault' into 'master'

Enable Style/SpaceAroundEqualsInParameterDefault cop

## What does this MR do?
Enable a new rubocop cops as discussed here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1877#note_13529646

## Are there points in the code the reviewer needs to double check?
May be a good idea to send a message to people to prevent master red because of the new cop.

## Why was this MR needed?
We want to improve code style and not waste endbosses time checking style manually

## What are the relevant issue numbers?

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5693
parents 8bce4a3f c9aa1988
...@@ -373,6 +373,10 @@ Style/SpaceAfterNot: ...@@ -373,6 +373,10 @@ Style/SpaceAfterNot:
Style/SpaceAfterSemicolon: Style/SpaceAfterSemicolon:
Enabled: true Enabled: true
# Use space around equals in parameter default
Style/SpaceAroundEqualsInParameterDefault:
Enabled: true
# Use a space around keywords if appropriate. # Use a space around keywords if appropriate.
Style/SpaceAroundKeyword: Style/SpaceAroundKeyword:
Enabled: true Enabled: true
......
...@@ -339,13 +339,6 @@ Style/SingleLineBlockParams: ...@@ -339,13 +339,6 @@ Style/SingleLineBlockParams:
Style/SingleLineMethods: Style/SingleLineMethods:
Enabled: false Enabled: false
# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Style/SpaceAroundEqualsInParameterDefault:
Enabled: false
# Offense count: 119 # Offense count: 119
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
......
...@@ -33,7 +33,7 @@ class RegistrationsController < Devise::RegistrationsController ...@@ -33,7 +33,7 @@ class RegistrationsController < Devise::RegistrationsController
protected protected
def build_resource(hash=nil) def build_resource(hash = nil)
super super
end end
......
module ExploreHelper module ExploreHelper
def filter_projects_path(options={}) def filter_projects_path(options = {})
exist_opts = { exist_opts = {
sort: params[:sort], sort: params[:sort],
scope: params[:scope], scope: params[:scope],
......
...@@ -107,7 +107,7 @@ module SearchHelper ...@@ -107,7 +107,7 @@ module SearchHelper
Sanitize.clean(str) Sanitize.clean(str)
end end
def search_filter_path(options={}) def search_filter_path(options = {})
exist_opts = { exist_opts = {
search: params[:search], search: params[:search],
project_id: params[:project_id], project_id: params[:project_id],
......
...@@ -36,7 +36,7 @@ class MergeRequestDiff < ActiveRecord::Base ...@@ -36,7 +36,7 @@ class MergeRequestDiff < ActiveRecord::Base
real_size.presence || raw_diffs.size real_size.presence || raw_diffs.size
end end
def raw_diffs(options={}) def raw_diffs(options = {})
if options[:ignore_whitespace_change] if options[:ignore_whitespace_change]
@raw_diffs_no_whitespace ||= begin @raw_diffs_no_whitespace ||= begin
compare = Gitlab::Git::Compare.new( compare = Gitlab::Git::Compare.new(
......
...@@ -601,7 +601,7 @@ class Repository ...@@ -601,7 +601,7 @@ class Repository
commit(sha) commit(sha)
end end
def next_branch(name, opts={}) def next_branch(name, opts = {})
branch_ids = self.branch_names.map do |n| branch_ids = self.branch_names.map do |n|
next 1 if n == name next 1 if n == name
result = n.match(/\A#{name}-([0-9]+)\z/) result = n.match(/\A#{name}-([0-9]+)\z/)
......
...@@ -25,7 +25,7 @@ module Gitlab ...@@ -25,7 +25,7 @@ module Gitlab
end end
end end
def initialize(user, adapter=nil) def initialize(user, adapter = nil)
@adapter = adapter @adapter = adapter
@user = user @user = user
@provider = user.ldap_identity.provider @provider = user.ldap_identity.provider
......
...@@ -13,7 +13,7 @@ module Gitlab ...@@ -13,7 +13,7 @@ module Gitlab
Gitlab::LDAP::Config.new(provider) Gitlab::LDAP::Config.new(provider)
end end
def initialize(provider, ldap=nil) def initialize(provider, ldap = nil)
@provider = provider @provider = provider
@ldap = ldap || Net::LDAP.new(config.adapter_options) @ldap = ldap || Net::LDAP.new(config.adapter_options)
end end
......
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
module Popen module Popen
extend self extend self
def popen(cmd, path=nil) def popen(cmd, path = nil)
unless cmd.is_a?(Array) unless cmd.is_a?(Array)
raise "System commands must be given as an array of strings" raise "System commands must be given as an array of strings"
end end
......
...@@ -37,7 +37,7 @@ module Gitlab ...@@ -37,7 +37,7 @@ module Gitlab
redis_config_hash redis_config_hash
end end
def initialize(rails_env=nil) def initialize(rails_env = nil)
rails_env ||= Rails.env rails_env ||= Rails.env
config_file = File.expand_path('../../../config/resque.yml', __FILE__) config_file = File.expand_path('../../../config/resque.yml', __FILE__)
......
...@@ -349,19 +349,19 @@ describe 'Git HTTP requests', lib: true do ...@@ -349,19 +349,19 @@ describe 'Git HTTP requests', lib: true do
end end
end end
def clone_get(project, options={}) def clone_get(project, options = {})
get "/#{project}/info/refs", { service: 'git-upload-pack' }, auth_env(*options.values_at(:user, :password, :spnego_request_token)) get "/#{project}/info/refs", { service: 'git-upload-pack' }, auth_env(*options.values_at(:user, :password, :spnego_request_token))
end end
def clone_post(project, options={}) def clone_post(project, options = {})
post "/#{project}/git-upload-pack", {}, auth_env(*options.values_at(:user, :password, :spnego_request_token)) post "/#{project}/git-upload-pack", {}, auth_env(*options.values_at(:user, :password, :spnego_request_token))
end end
def push_get(project, options={}) def push_get(project, options = {})
get "/#{project}/info/refs", { service: 'git-receive-pack' }, auth_env(*options.values_at(:user, :password, :spnego_request_token)) get "/#{project}/info/refs", { service: 'git-receive-pack' }, auth_env(*options.values_at(:user, :password, :spnego_request_token))
end end
def push_post(project, options={}) def push_post(project, options = {})
post "/#{project}/git-receive-pack", {}, auth_env(*options.values_at(:user, :password, :spnego_request_token)) post "/#{project}/git-receive-pack", {}, auth_env(*options.values_at(:user, :password, :spnego_request_token))
end end
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
module Select2Helper module Select2Helper
def select2(value, options={}) def select2(value, options = {})
raise ArgumentError, 'options must be a Hash' unless options.kind_of?(Hash) raise ArgumentError, 'options must be a Hash' unless options.kind_of?(Hash)
selector = options.fetch(:from) selector = options.fetch(:from)
......
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