Skip to content
Snippets Groups Projects
Commit 12bc446e authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Merge branch 'update-rubocop' into tmp

* update-rubocop:
  Use stable gitlab-styles and eliminate offenses
  Updates from `rubocop -a`
  Update rubocop to get rid of a warning in other MR
parent efd40b2d
No related branches found
No related tags found
No related merge requests found
Showing
with 38 additions and 38 deletions
Loading
Loading
@@ -31,6 +31,12 @@ Style/MutableConstant:
- 'ee/db/post_migrate/**/*'
- 'ee/db/geo/migrate/**/*'
 
Naming/UncommunicativeMethodParamName:
Enabled: false
Naming/MemoizedInstanceVariableName:
Enabled: false
Naming/FileName:
ExpectMatchingDefinition: true
Exclude:
Loading
Loading
Loading
Loading
@@ -199,12 +199,6 @@ Naming/HeredocDelimiterCase:
Naming/HeredocDelimiterNaming:
Enabled: false
 
# Offense count: 27
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Performance/HashEachMethods:
Enabled: false
# Offense count: 1
Performance/UnfreezeString:
Exclude:
Loading
Loading
Loading
Loading
@@ -363,9 +363,9 @@ group :development, :test do
gem 'spring', '~> 2.0.0'
gem 'spring-commands-rspec', '~> 1.0.4'
 
gem 'gitlab-styles', '~> 2.3', require: false
gem 'gitlab-styles', '~> 2.4', require: false
# Pin these dependencies, otherwise a new rule could break the CI pipelines
gem 'rubocop', '~> 0.52.1'
gem 'rubocop', '~> 0.54.0'
gem 'rubocop-rspec', '~> 1.22.1'
 
gem 'scss_lint', '~> 0.56.0', require: false
Loading
Loading
Loading
Loading
@@ -337,8 +337,8 @@ GEM
posix-spawn (~> 0.3)
gitlab-license (1.0.0)
gitlab-markup (1.6.4)
gitlab-styles (2.3.2)
rubocop (~> 0.51)
gitlab-styles (2.4.0)
rubocop (~> 0.54.0)
rubocop-gitlab-security (~> 0.1.0)
rubocop-rspec (~> 1.19)
gitlab_omniauth-ldap (2.0.4)
Loading
Loading
@@ -805,9 +805,9 @@ GEM
pg
rails
sqlite3
rubocop (0.52.1)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
Loading
Loading
@@ -1078,7 +1078,7 @@ DEPENDENCIES
gitlab-gollum-rugged_adapter (~> 0.4.4)
gitlab-license (~> 1.0)
gitlab-markup (~> 1.6.4)
gitlab-styles (~> 2.3)
gitlab-styles (~> 2.4)
gitlab_omniauth-ldap (~> 2.0.4)
gon (~> 6.2)
google-api-client (~> 0.19.8)
Loading
Loading
@@ -1180,7 +1180,7 @@ DEPENDENCIES
rspec-retry (~> 0.4.5)
rspec-set (~> 0.1.3)
rspec_profiling (~> 0.0.5)
rubocop (~> 0.52.1)
rubocop (~> 0.54.0)
rubocop-rspec (~> 1.22.1)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 0.17.0)
Loading
Loading
Loading
Loading
@@ -340,8 +340,8 @@ GEM
posix-spawn (~> 0.3)
gitlab-license (1.0.0)
gitlab-markup (1.6.4)
gitlab-styles (2.3.2)
rubocop (~> 0.51)
gitlab-styles (2.4.0)
rubocop (~> 0.54.0)
rubocop-gitlab-security (~> 0.1.0)
rubocop-rspec (~> 1.19)
gitlab_omniauth-ldap (2.0.4)
Loading
Loading
@@ -814,9 +814,9 @@ GEM
pg
rails
sqlite3
rubocop (0.52.1)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
Loading
Loading
@@ -1088,7 +1088,7 @@ DEPENDENCIES
gitlab-gollum-rugged_adapter (~> 0.4.4)
gitlab-license (~> 1.0)
gitlab-markup (~> 1.6.4)
gitlab-styles (~> 2.3)
gitlab-styles (~> 2.4)
gitlab_omniauth-ldap (~> 2.0.4)
gon (~> 6.2)
google-api-client (~> 0.19.8)
Loading
Loading
@@ -1191,7 +1191,7 @@ DEPENDENCIES
rspec-retry (~> 0.4.5)
rspec-set (~> 0.1.3)
rspec_profiling (~> 0.0.5)
rubocop (~> 0.52.1)
rubocop (~> 0.54.0)
rubocop-rspec (~> 1.22.1)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 0.17.0)
Loading
Loading
Loading
Loading
@@ -2,9 +2,9 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
 
require File.expand_path('../config/application', __FILE__)
require File.expand_path('config/application', __dir__)
 
relative_url_conf = File.expand_path('../config/initializers/relative_url', __FILE__)
relative_url_conf = File.expand_path('config/initializers/relative_url', __dir__)
require relative_url_conf if File.exist?("#{relative_url_conf}.rb")
 
Gitlab::Application.load_tasks
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ def edit
end
 
def update
if deploy_key.update_attributes(update_params)
if deploy_key.update(update_params)
flash[:notice] = 'Deploy key was successfully updated.'
redirect_to admin_deploy_keys_path
else
Loading
Loading
@@ -34,7 +34,7 @@ def destroy
deploy_key.destroy
 
respond_to do |format|
format.html { redirect_to admin_deploy_keys_path, status: 302 }
format.html { redirect_to admin_deploy_keys_path, status: :found }
format.json { head :ok }
end
end
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ def create
end
 
def update
if @group.update_attributes(group_params)
if @group.update(group_params)
redirect_to [:admin, @group], notice: 'Group was successfully updated.'
else
render "edit"
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ def edit
end
 
def update
if hook.update_attributes(hook_params)
if hook.update(hook_params)
flash[:notice] = 'System hook was successfully updated.'
redirect_to admin_hooks_path
else
Loading
Loading
@@ -34,7 +34,7 @@ def update
def destroy
hook.destroy
 
redirect_to admin_hooks_path, status: 302
redirect_to admin_hooks_path, status: :found
end
 
def test
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ def edit
end
 
def update
if @identity.update_attributes(identity_params)
if @identity.update(identity_params)
RepairLdapBlockedUserService.new(@user).execute
redirect_to admin_user_identities_path(@user), notice: 'User identity was successfully updated.'
else
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ def destroy
 
session[:impersonator_id] = nil
 
redirect_to admin_user_path(original_user), status: 302
redirect_to admin_user_path(original_user), status: :found
end
 
private
Loading
Loading
Loading
Loading
@@ -20,6 +20,6 @@ def index
def cancel_all
Ci::Build.running_or_pending.each(&:cancel)
 
redirect_to admin_jobs_path, status: 303
redirect_to admin_jobs_path, status: :see_other
end
end
Loading
Loading
@@ -16,7 +16,7 @@ def destroy
runner = rp.runner
rp.destroy
 
redirect_to admin_runner_path(runner), status: 302
redirect_to admin_runner_path(runner), status: :found
end
 
private
Loading
Loading
Loading
Loading
@@ -28,7 +28,7 @@ def update
def destroy
@runner.destroy
 
redirect_to admin_runners_path, status: 302
redirect_to admin_runners_path, status: :found
end
 
def resume
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ def edit
end
 
def update
if service.update_attributes(service_params[:service])
if service.update(service_params[:service])
PropagateServiceTemplateWorker.perform_async(service.id) if service.active?
 
redirect_to admin_application_settings_services_path,
Loading
Loading
Loading
Loading
@@ -165,7 +165,7 @@ def remove_email
format.json { head :ok }
else
format.html { redirect_back_or_admin_user(alert: 'There was an error removing the e-mail.') }
format.json { render json: 'There was an error removing the e-mail.', status: 400 }
format.json { render json: 'There was an error removing the e-mail.', status: :bad_request }
end
end
end
Loading
Loading
Loading
Loading
@@ -128,7 +128,7 @@ def render_conflict_response
errors: [
"Someone edited this #{issuable.human_class_name} at the same time you did. Please refresh your browser and make sure your changes will not unintentionally remove theirs."
]
}, status: 409
}, status: :conflict
end
end
end
Loading
Loading
Loading
Loading
@@ -28,7 +28,7 @@ def require_lfs_enabled!
message: 'Git LFS is not enabled on this GitLab server, contact your admin.',
documentation_url: help_url
},
status: 501
status: :not_implemented
)
end
 
Loading
Loading
Loading
Loading
@@ -7,6 +7,6 @@ def destroy
@group.remove_avatar!
@group.save
 
redirect_to edit_group_path(@group), status: 302
redirect_to edit_group_path(@group), status: :found
end
end
Loading
Loading
@@ -23,7 +23,7 @@ def update
def destroy
@runner.destroy
 
redirect_to group_settings_ci_cd_path(@group, anchor: 'runners-settings'), status: 302
redirect_to group_settings_ci_cd_path(@group, anchor: 'runners-settings'), status: :found
end
 
def resume
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment