From 922edc976d962c99cbefd9098f0667e674fd366e Mon Sep 17 00:00:00 2001
From: Vitali Tatarintev <vtatarintev@gitlab.com>
Date: Tue, 17 Oct 2023 11:00:22 +0200
Subject: [PATCH] Fix Layout/ArgumentAlignment offenses in specs

Fix Layout/ArgumentAlignment offenses in:

* spec/routing
* spec/rubocop
* spec/sidekiq
* spec/support/shared_examples
---
 .rubocop_todo/layout/argument_alignment.yml   |  12 --
 spec/routing/environments_spec.rb             |   6 +-
 spec/routing/group_routing_spec.rb            |   4 +-
 spec/routing/project_routing_spec.rb          | 197 ++++++++++++------
 spec/routing/routing_spec.rb                  |   8 +-
 spec/rubocop/cop/rspec/env_mocking_spec.rb    |  12 +-
 .../regexp_literal_mixed_preserve_spec.rb     |   8 +-
 .../formatter/graceful_formatter_spec.rb      |  27 +--
 spec/sidekiq/cron/job_gem_dependency_spec.rb  |   9 +-
 ...uses_gitlab_url_blocker_shared_examples.rb |  42 ++--
 .../integrations/integration_settings_form.rb |   6 +-
 .../lib/gitlab/ci/ci_trace_shared_examples.rb |   2 +-
 ...ackground_migration_job_shared_examples.rb |  14 +-
 13 files changed, 208 insertions(+), 139 deletions(-)

diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml
index 98fa7fd4622de..dd8f8bea1aeb8 100644
--- a/.rubocop_todo/layout/argument_alignment.yml
+++ b/.rubocop_todo/layout/argument_alignment.yml
@@ -1759,18 +1759,6 @@ Layout/ArgumentAlignment:
     - 'spec/requests/recursive_webhook_detection_spec.rb'
     - 'spec/requests/users/group_callouts_spec.rb'
     - 'spec/requests/users/project_callouts_spec.rb'
-    - 'spec/routing/environments_spec.rb'
-    - 'spec/routing/group_routing_spec.rb'
-    - 'spec/routing/project_routing_spec.rb'
-    - 'spec/routing/routing_spec.rb'
-    - 'spec/rubocop/cop/rspec/env_mocking_spec.rb'
-    - 'spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb'
-    - 'spec/rubocop/formatter/graceful_formatter_spec.rb'
-    - 'spec/sidekiq/cron/job_gem_dependency_spec.rb'
-    - 'spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb'
-    - 'spec/support/shared_examples/integrations/integration_settings_form.rb'
-    - 'spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb'
-    - 'spec/support/shared_examples/lib/gitlab/database/background_migration_job_shared_examples.rb'
     - 'spec/tasks/cache_rake_spec.rb'
     - 'spec/tasks/gitlab/cleanup_rake_spec.rb'
     - 'spec/tasks/gitlab/db/decomposition/rollback/bump_ci_sequences_rake_spec.rb'
diff --git a/spec/routing/environments_spec.rb b/spec/routing/environments_spec.rb
index 5ba02c384e227..08353390483d7 100644
--- a/spec/routing/environments_spec.rb
+++ b/spec/routing/environments_spec.rb
@@ -6,8 +6,7 @@
   let(:project) { create(:project) }
 
   let(:environment) do
-    create(:environment, project: project,
-                         name: 'staging-1.0/review')
+    create(:environment, project: project, name: 'staging-1.0/review')
   end
 
   let(:environments_route) do
@@ -42,8 +41,7 @@ def get_folder(folder)
   end
 
   def folder_action(**opts)
-    options = { namespace_id: project.namespace.path,
-                project_id: project.path }
+    options = { namespace_id: project.namespace.path, project_id: project.path }
 
     ['projects/environments#folder', options.merge(opts)]
   end
diff --git a/spec/routing/group_routing_spec.rb b/spec/routing/group_routing_spec.rb
index 6fab711d05a85..ba50e8eccc123 100644
--- a/spec/routing/group_routing_spec.rb
+++ b/spec/routing/group_routing_spec.rb
@@ -49,9 +49,7 @@
 
   it 'routes to the avatars controller' do
     expect(delete("/groups/#{group_path}/-/avatar"))
-      .to route_to(group_id: group_path,
-                   controller: 'groups/avatars',
-                   action: 'destroy')
+      .to route_to(group_id: group_path, controller: 'groups/avatars', action: 'destroy')
   end
 
   it 'routes to the boards controller' do
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index abc42d11c633c..82d58d12607a0 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -211,11 +211,20 @@
       expect(get('/gitlab/gitlabhq/-/refs/feature%2B45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz')
       expect(get('/gitlab/gitlabhq/-/refs/feature@45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45', path: 'foo/bar/baz')
       expect(get('/gitlab/gitlabhq/-/refs/stable/logs_tree/files.scss')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'files.scss')
-      assert_routing({ path: "/gitlab/gitlabhq/-/refs/stable/logs_tree/new%0A%0Aline.txt",
-                       method: :get },
-                     { controller: 'projects/refs', action: 'logs_tree',
-                       namespace_id: 'gitlab', project_id: 'gitlabhq',
-                       id: "stable", path: "new\n\nline.txt" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/refs/stable/logs_tree/new%0A%0Aline.txt",
+          method: :get
+        },
+        {
+          controller: 'projects/refs',
+          action: 'logs_tree',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "stable",
+          path: "new\n\nline.txt"
+        }
+      )
     end
 
     it_behaves_like 'redirecting a legacy path', '/gitlab/gitlabhq/refs/switch', '/gitlab/gitlabhq/-/refs/switch'
@@ -498,11 +507,19 @@
       expect(get('/gitlab/gitlabhq/-/blame/master/files.scss')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/blame/master/#{url_encoded_newline_file}",
-                       method: :get },
-                    { controller: 'projects/blame', action: 'show',
-                      namespace_id: 'gitlab', project_id: 'gitlabhq',
-                      id: "master/#{newline_file}" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/blame/master/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/blame',
+          action: 'show',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "master/#{newline_file}"
+        }
+      )
     end
 
     it 'to #streaming' do
@@ -525,11 +542,19 @@
       expect(get('/gitlab/gitlabhq/-/blob/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'blob/master/blob/index.js')
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/blob/blob/master/blob/#{url_encoded_newline_file}",
-                       method: :get },
-                    { controller: 'projects/blob', action: 'show',
-                      namespace_id: 'gitlab', project_id: 'gitlabhq',
-                      id: "blob/master/blob/#{newline_file}" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/blob/blob/master/blob/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/blob',
+          action: 'show',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "blob/master/blob/#{newline_file}"
+        }
+      )
     end
 
     it 'to #show from unscoped routing' do
@@ -546,11 +571,19 @@
       expect(get('/gitlab/gitlabhq/-/tree/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'tree/master/tree/files')
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/tree/master/#{url_encoded_newline_file}",
-                       method: :get },
-                    { controller: 'projects/tree', action: 'show',
-                      namespace_id: 'gitlab', project_id: 'gitlabhq',
-                      id: "master/#{newline_file}" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/tree/master/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/tree',
+          action: 'show',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "master/#{newline_file}"
+        }
+      )
     end
 
     it 'to #show from unscoped routing' do
@@ -566,22 +599,38 @@
       expect(get('/gitlab/gitlabhq/-/find_file/master')).to route_to('projects/find_file#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master')
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/find_file/#{url_encoded_newline_file}",
-                       method: :get },
-                    { controller: 'projects/find_file', action: 'show',
-                      namespace_id: 'gitlab', project_id: 'gitlabhq',
-                      id: newline_file.to_s })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/find_file/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/find_file',
+          action: 'show',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: newline_file.to_s
+        }
+      )
     end
 
     it 'to #list' do
       expect(get('/gitlab/gitlabhq/-/files/master.json')).to route_to('projects/find_file#list', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.json')
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/files/#{url_encoded_newline_file}",
-                       method: :get },
-                    { controller: 'projects/find_file', action: 'list',
-                      namespace_id: 'gitlab', project_id: 'gitlabhq',
-                      id: newline_file.to_s })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/files/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/find_file',
+          action: 'list',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: newline_file.to_s
+        }
+      )
     end
 
     it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/find_file", "/gitlab/gitlabhq/-/find_file"
@@ -591,30 +640,44 @@
   describe Projects::BlobController, 'routing' do
     it 'to #edit' do
       expect(get('/gitlab/gitlabhq/-/edit/master/app/models/project.rb')).to(
-        route_to('projects/blob#edit',
-                 namespace_id: 'gitlab', project_id: 'gitlabhq',
-                 id: 'master/app/models/project.rb'))
+        route_to('projects/blob#edit', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
+      )
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/edit/master/docs/#{url_encoded_newline_file}",
-                       method: :get },
-                      { controller: 'projects/blob', action: 'edit',
-                        namespace_id: 'gitlab', project_id: 'gitlabhq',
-                        id: "master/docs/#{newline_file}" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/edit/master/docs/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/blob',
+          action: 'edit',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "master/docs/#{newline_file}"
+        }
+      )
     end
 
     it 'to #preview' do
       expect(post('/gitlab/gitlabhq/-/preview/master/app/models/project.rb')).to(
-        route_to('projects/blob#preview',
-                 namespace_id: 'gitlab', project_id: 'gitlabhq',
-                 id: 'master/app/models/project.rb'))
+        route_to('projects/blob#preview', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
+      )
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/edit/master/docs/#{url_encoded_newline_file}",
-                       method: :get },
-                      { controller: 'projects/blob', action: 'edit',
-                        namespace_id: 'gitlab', project_id: 'gitlabhq',
-                        id: "master/docs/#{newline_file}" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/edit/master/docs/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/blob',
+          action: 'edit',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "master/docs/#{newline_file}"
+        }
+      )
     end
 
     it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/new/master", "/gitlab/gitlabhq/-/new/master"
@@ -626,11 +689,19 @@
     it 'to #show' do
       newline_file = "new\n\nline.txt"
       url_encoded_newline_file = ERB::Util.url_encode(newline_file)
-      assert_routing({ path: "/gitlab/gitlabhq/-/raw/master/#{url_encoded_newline_file}",
-                       method: :get },
-                    { controller: 'projects/raw', action: 'show',
-                      namespace_id: 'gitlab', project_id: 'gitlabhq',
-                      id: "master/#{newline_file}" })
+      assert_routing(
+        {
+          path: "/gitlab/gitlabhq/-/raw/master/#{url_encoded_newline_file}",
+          method: :get
+        },
+        {
+          controller: 'projects/raw',
+          action: 'show',
+          namespace_id: 'gitlab',
+          project_id: 'gitlabhq',
+          id: "master/#{newline_file}"
+        }
+      )
     end
 
     it 'to #show from unscoped routing' do
@@ -743,20 +814,24 @@
     describe '#destroy' do
       it 'correctly routes to a destroy action' do
         expect(delete('/gitlab/gitlabhq/registry/repository/1/tags/rc1'))
-          .to route_to('projects/registry/tags#destroy',
-                       namespace_id: 'gitlab',
-                       project_id: 'gitlabhq',
-                       repository_id: '1',
-                       id: 'rc1')
+          .to route_to(
+            'projects/registry/tags#destroy',
+            namespace_id: 'gitlab',
+            project_id: 'gitlabhq',
+            repository_id: '1',
+            id: 'rc1'
+          )
       end
 
       it 'takes registry tag name constrains into account' do
         expect(delete('/gitlab/gitlabhq/registry/repository/1/tags/-rc1'))
-          .not_to route_to('projects/registry/tags#destroy',
-                           namespace_id: 'gitlab',
-                           project_id: 'gitlabhq',
-                           repository_id: '1',
-                           id: '-rc1')
+          .not_to route_to(
+            'projects/registry/tags#destroy',
+            namespace_id: 'gitlab',
+            project_id: 'gitlabhq',
+            repository_id: '1',
+            id: '-rc1'
+          )
       end
     end
   end
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index a59ca5211ed4a..7c4f040266ed8 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -113,14 +113,10 @@
 
   it 'to #show' do
     path = '/help/user/markdown.md'
-    expect(get(path)).to route_to('help#show',
-                                  path: 'user/markdown',
-                                  format: 'md')
+    expect(get(path)).to route_to('help#show', path: 'user/markdown', format: 'md')
 
     path = '/help/user/markdown/markdown_logo.png'
-    expect(get(path)).to route_to('help#show',
-                                  path: 'user/markdown/markdown_logo',
-                                  format: 'png')
+    expect(get(path)).to route_to('help#show', path: 'user/markdown/markdown_logo', format: 'png')
   end
 end
 
diff --git a/spec/rubocop/cop/rspec/env_mocking_spec.rb b/spec/rubocop/cop/rspec/env_mocking_spec.rb
index 189fccf483a25..fec2000c88be8 100644
--- a/spec/rubocop/cop/rspec/env_mocking_spec.rb
+++ b/spec/rubocop/cop/rspec/env_mocking_spec.rb
@@ -34,23 +34,23 @@
 
   context 'with mocking bracket calls ' do
     it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env',
-                    offense_call_brackets_string_quotes, %(stub_env('FOO', 'bar'))
+      offense_call_brackets_string_quotes, %(stub_env('FOO', 'bar'))
     it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env',
-                    offense_call_brackets_variables, %(stub_env(key, value))
+      offense_call_brackets_variables, %(stub_env(key, value))
   end
 
   context 'with mocking fetch calls' do
     it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env',
-                    offense_call_fetch_string_quotes, %(stub_env('FOO', 'bar'))
+      offense_call_fetch_string_quotes, %(stub_env('FOO', 'bar'))
     it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env',
-                    offense_call_fetch_variables, %(stub_env(key, value))
+      offense_call_fetch_variables, %(stub_env(key, value))
   end
 
   context 'with other special cases and variations' do
     it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env',
-                    offense_call_root_env_variables, %(stub_env(key, value))
+      offense_call_root_env_variables, %(stub_env(key, value))
     it_behaves_like 'cop offense mocking the ENV constant correctable with stub_env',
-                    offense_call_key_value_method_calls, %(stub_env(fetch_key(object), fetch_value(object)))
+      offense_call_key_value_method_calls, %(stub_env(fetch_key(object), fetch_value(object)))
   end
 
   context 'with acceptable cases' do
diff --git a/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb b/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb
index 1d1c0852db296..d2ccd504fcdc6 100644
--- a/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb
+++ b/spec/rubocop/cop/style/regexp_literal_mixed_preserve_spec.rb
@@ -10,10 +10,10 @@
 RSpec.describe RuboCop::Cop::Style::RegexpLiteralMixedPreserve, :config do
   let(:config) do
     supported_styles = { 'SupportedStyles' => %w[slashes percent_r mixed mixed_preserve] }
-    RuboCop::Config.new('Style/PercentLiteralDelimiters' =>
-                          percent_literal_delimiters_config,
-                        'Style/RegexpLiteralMixedPreserve' =>
-                          cop_config.merge(supported_styles))
+    RuboCop::Config.new(
+      'Style/PercentLiteralDelimiters' => percent_literal_delimiters_config,
+      'Style/RegexpLiteralMixedPreserve' => cop_config.merge(supported_styles)
+    )
   end
 
   let(:percent_literal_delimiters_config) { { 'PreferredDelimiters' => { '%r' => '{}' } } }
diff --git a/spec/rubocop/formatter/graceful_formatter_spec.rb b/spec/rubocop/formatter/graceful_formatter_spec.rb
index d76e566e2b4a7..b9a56bec11589 100644
--- a/spec/rubocop/formatter/graceful_formatter_spec.rb
+++ b/spec/rubocop/formatter/graceful_formatter_spec.rb
@@ -220,19 +220,20 @@
 
   def fake_offense(cop_name)
     # rubocop:disable RSpec/VerifiedDoubles
-    double(:offense,
-           cop_name: cop_name,
-           corrected?: false,
-           correctable?: false,
-           severity: double(:severity, name: :convention, code: :C),
-           line: 5,
-           column: 23,
-           real_column: 23,
-           corrected_with_todo?: false,
-           message: "#{cop_name} message",
-           location: double(:location, source_line: 'line', first_line: 1, last_line: 1, single_line?: true),
-           highlighted_area: double(:highlighted_area, begin_pos: 1, size: 2, source_buffer: 'line', source: 'i')
-          )
+    double(
+      :offense,
+      cop_name: cop_name,
+      corrected?: false,
+      correctable?: false,
+      severity: double(:severity, name: :convention, code: :C),
+      line: 5,
+      column: 23,
+      real_column: 23,
+      corrected_with_todo?: false,
+      message: "#{cop_name} message",
+      location: double(:location, source_line: 'line', first_line: 1, last_line: 1, single_line?: true),
+      highlighted_area: double(:highlighted_area, begin_pos: 1, size: 2, source_buffer: 'line', source: 'i')
+    )
     # rubocop:enable RSpec/VerifiedDoubles
   end
 end
diff --git a/spec/sidekiq/cron/job_gem_dependency_spec.rb b/spec/sidekiq/cron/job_gem_dependency_spec.rb
index 38c658feba635..c6103ed623174 100644
--- a/spec/sidekiq/cron/job_gem_dependency_spec.rb
+++ b/spec/sidekiq/cron/job_gem_dependency_spec.rb
@@ -6,10 +6,11 @@
   describe 'cron jobs' do
     context 'when Fugit depends on ZoTime or EoTime' do
       before do
-        described_class
-          .create(name: 'TestCronWorker', # rubocop:disable Rails/SaveBang
-                  cron: Settings.cron_jobs[:pipeline_schedule_worker]['cron'],
-                  class: Settings.cron_jobs[:pipeline_schedule_worker]['job_class'])
+        described_class.create( # rubocop:disable Rails/SaveBang
+          name: 'TestCronWorker',
+          cron: Settings.cron_jobs[:pipeline_schedule_worker]['cron'],
+          class: Settings.cron_jobs[:pipeline_schedule_worker]['job_class']
+        )
       end
 
       it 'does not get any errors' do
diff --git a/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb b/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb
index cef76bd4356bd..3119a03b1cbbe 100644
--- a/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb
+++ b/spec/support/shared_examples/initializers/uses_gitlab_url_blocker_shared_examples.rb
@@ -31,29 +31,33 @@
     it 'raises error when it is a request that resolves to a local address' do
       stub_full_request('https://example.com', method: http_method, ip_address: '172.16.0.0')
 
-      expect { make_request('https://example.com') }
-        .to raise_error(url_blocked_error_class,
-                        "URL is blocked: Requests to the local network are not allowed")
+      expect { make_request('https://example.com') }.to raise_error(
+        url_blocked_error_class,
+        "URL is blocked: Requests to the local network are not allowed"
+      )
     end
 
     it 'raises error when it is a request that resolves to a localhost address' do
       stub_full_request('https://example.com', method: http_method, ip_address: '127.0.0.1')
 
-      expect { make_request('https://example.com') }
-        .to raise_error(url_blocked_error_class,
-                        "URL is blocked: Requests to localhost are not allowed")
+      expect { make_request('https://example.com') }.to raise_error(
+        url_blocked_error_class,
+        "URL is blocked: Requests to localhost are not allowed"
+      )
     end
 
     it 'raises error when it is a request to local address' do
-      expect { make_request('http://172.16.0.0') }
-        .to raise_error(url_blocked_error_class,
-                        "URL is blocked: Requests to the local network are not allowed")
+      expect { make_request('http://172.16.0.0') }.to raise_error(
+        url_blocked_error_class,
+        "URL is blocked: Requests to the local network are not allowed"
+      )
     end
 
     it 'raises error when it is a request to localhost address' do
-      expect { make_request('http://127.0.0.1') }
-        .to raise_error(url_blocked_error_class,
-                        "URL is blocked: Requests to localhost are not allowed")
+      expect { make_request('http://127.0.0.1') }.to raise_error(
+        url_blocked_error_class,
+        "URL is blocked: Requests to localhost are not allowed"
+      )
     end
   end
 
@@ -67,15 +71,17 @@
     end
 
     it 'raises error when it is a request to local address' do
-      expect { make_request('https://172.16.0.0:8080') }
-        .to raise_error(url_blocked_error_class,
-                        "URL is blocked: Requests to the local network are not allowed")
+      expect { make_request('https://172.16.0.0:8080') }.to raise_error(
+        url_blocked_error_class,
+        "URL is blocked: Requests to the local network are not allowed"
+      )
     end
 
     it 'raises error when it is a request to localhost address' do
-      expect { make_request('https://127.0.0.1:8080') }
-        .to raise_error(url_blocked_error_class,
-                        "URL is blocked: Requests to localhost are not allowed")
+      expect { make_request('https://127.0.0.1:8080') }.to raise_error(
+        url_blocked_error_class,
+        "URL is blocked: Requests to localhost are not allowed"
+      )
     end
   end
 
diff --git a/spec/support/shared_examples/integrations/integration_settings_form.rb b/spec/support/shared_examples/integrations/integration_settings_form.rb
index 1d7f74837f266..c665f6a57f150 100644
--- a/spec/support/shared_examples/integrations/integration_settings_form.rb
+++ b/spec/support/shared_examples/integrations/integration_settings_form.rb
@@ -16,7 +16,7 @@
 
         page.within('form.integration-settings-form') do
           expect(page).to have_field('Active', type: 'checkbox', wait: 0),
-                          "#{integration.title} active field not present"
+            "#{integration.title} active field not present"
 
           fields = parse_json(fields_for_integration(integration))
           fields.each do |field|
@@ -24,7 +24,7 @@
 
             field_name = field[:name]
             expect(page).to have_field(field[:title], wait: 0),
-                            "#{integration.title} field #{field_name} not present"
+              "#{integration.title} field #{field_name} not present"
           end
 
           api_only_fields = integration.fields.select { _1[:api_only] }
@@ -43,7 +43,7 @@
                             end
 
             expect(page).to have_field(trigger_title, type: 'checkbox', wait: 0),
-                            "#{integration.title} field #{trigger_title} checkbox not present"
+              "#{integration.title} field #{trigger_title} checkbox not present"
           end
         end
       end
diff --git a/spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb
index 7cfab5c829528..0cc525d0575d6 100644
--- a/spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb
+++ b/spec/support/shared_examples/lib/gitlab/ci/ci_trace_shared_examples.rb
@@ -113,7 +113,7 @@
       it "returns valid sections" do
         expect(sections).not_to be_empty
         expect(sections.size).to eq(sections_data.size),
-                                 "expected #{sections_data.size} sections, got #{sections.size}"
+          "expected #{sections_data.size} sections, got #{sections.size}"
 
         buff = StringIO.new(log)
         sections.each_with_index do |s, i|
diff --git a/spec/support/shared_examples/lib/gitlab/database/background_migration_job_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/database/background_migration_job_shared_examples.rb
index 286f10a186dea..d1367bbe144de 100644
--- a/spec/support/shared_examples/lib/gitlab/database/background_migration_job_shared_examples.rb
+++ b/spec/support/shared_examples/lib/gitlab/database/background_migration_job_shared_examples.rb
@@ -2,8 +2,11 @@
 
 RSpec.shared_examples 'marks background migration job records' do
   it 'marks each job record as succeeded after processing' do
-    create(:background_migration_job, class_name: "::#{described_class.name.demodulize}",
-                                      arguments: arguments)
+    create(
+      :background_migration_job,
+      class_name: "::#{described_class.name.demodulize}",
+      arguments: arguments
+    )
 
     expect(::Gitlab::Database::BackgroundMigrationJob).to receive(:mark_all_as_succeeded).and_call_original
 
@@ -13,8 +16,11 @@
   end
 
   it 'returns the number of job records marked as succeeded' do
-    create(:background_migration_job, class_name: "::#{described_class.name.demodulize}",
-                                      arguments: arguments)
+    create(
+      :background_migration_job,
+      class_name: "::#{described_class.name.demodulize}",
+      arguments: arguments
+    )
 
     jobs_updated = subject.perform(*arguments)
 
-- 
GitLab