From b8ff4b26b5f38e2fcdca487c5b7fc7d19af9ac61 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 18 May 2017 20:57:05 +0800 Subject: [PATCH] Disable rubocop hash check for blocks --- config/routes/project.rb | 6 ++++++ spec/features/projects/jobs_spec.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/routes/project.rb b/config/routes/project.rb index 77b65e2d162..95ca3281a3f 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -198,6 +198,8 @@ constraints(ProjectUrlConstrainer.new) do end end + # It's a block, not a hash, disabling style check for hash + # rubocop:disable Style/AlignHash get '/builds/:id/:action', as: 'action_legacy_build', to: redirect { |params, req| args = params.values_at(:namespace_id, :project_id, :id) @@ -214,12 +216,16 @@ constraints(ProjectUrlConstrainer.new) do end } + # It's a block, not a hash, disabling style check for hash + # rubocop:disable Style/AlignHash get '/builds/:id', as: 'legacy_build', to: redirect { |params, req| Gitlab::Routing.url_helpers.namespace_project_job_path( params[:namespace_id], params[:project_id], params[:id]) } + # It's a block, not a hash, disabling style check for hash + # rubocop:disable Style/AlignHash get '/builds', as: 'legacy_builds', to: redirect { |params, req| Gitlab::Routing.url_helpers.namespace_project_jobs_path( diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index b04c740dfc8..bd1bf64247f 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -501,7 +501,7 @@ feature 'Jobs', :feature do context "when visiting old URL" do let(:trace_job_url) do - trace_namespace_project_job_path(project.namespace, project, build,format: :json) + trace_namespace_project_job_path(project.namespace, project, build, format: :json) end before do