Skip to content
Snippets Groups Projects
Commit 20293882 authored by James Fargher's avatar James Fargher
Browse files

Merge branch '239356-fix-Layout/FirstArrayElementIndentation_11' into 'master'

Fix Layout/FirstArrayElementIndentation offenses 11

See merge request !98150



Merged-by: default avatarJames Fargher <proglottis@gmail.com>
Approved-by: default avatarValery Sizov <valery@gitlab.com>
Approved-by: default avatarJames Fargher <proglottis@gmail.com>
Co-authored-by: Thiago Figueiró's avatarThiago Figueiró <tfigueiro@gitlab.com>
parents 84906efd 00fb37c7
No related branches found
No related tags found
1 merge request!98150Fix Layout/FirstArrayElementIndentation offenses 11
Pipeline #643602945 failed
Pipeline: GitLab

#643606818

    Pipeline: GitLab

    #643604339

      Showing
      with 176 additions and 177 deletions
      ......@@ -60,26 +60,6 @@ Layout/FirstArrayElementIndentation:
      - 'qa/qa/specs/features/ee/browser_ui/3_create/repository/code_owners_with_protected_branch_and_squashed_commits_spec.rb'
      - 'qa/qa/specs/features/ee/browser_ui/4_verify/new_discussion_not_dropping_merge_trains_mr_spec.rb'
      - 'spec/controllers/concerns/send_file_upload_spec.rb'
      - 'spec/controllers/graphql_controller_spec.rb'
      - 'spec/controllers/projects/ci/daily_build_group_report_results_controller_spec.rb'
      - 'spec/controllers/projects/ci/lints_controller_spec.rb'
      - 'spec/controllers/projects/pipelines/tests_controller_spec.rb'
      - 'spec/controllers/projects/pipelines_controller_spec.rb'
      - 'spec/deprecation_toolkit_env.rb'
      - 'spec/features/clusters/create_agent_spec.rb'
      - 'spec/finders/bulk_imports/entities_finder_spec.rb'
      - 'spec/finders/ci/daily_build_group_report_results_finder_spec.rb'
      - 'spec/finders/deploy_tokens/tokens_finder_spec.rb'
      - 'spec/finders/groups/projects_requiring_authorizations_refresh/on_direct_membership_finder_spec.rb'
      - 'spec/finders/groups/projects_requiring_authorizations_refresh/on_transfer_finder_spec.rb'
      - 'spec/frontend/fixtures/search.rb'
      - 'spec/graphql/mutations/commits/create_spec.rb'
      - 'spec/graphql/mutations/environments/canary_ingress/update_spec.rb'
      - 'spec/graphql/resolvers/ci/test_suite_resolver_spec.rb'
      - 'spec/graphql/types/ci/runner_architecture_type_spec.rb'
      - 'spec/graphql/types/ci/runner_platform_type_spec.rb'
      - 'spec/graphql/types/metrics/dashboard_type_spec.rb'
      - 'spec/graphql/types/packages/composer/metadatum_type_spec.rb'
      - 'spec/graphql/types/packages/tag_type_spec.rb'
      - 'spec/helpers/application_settings_helper_spec.rb'
      - 'spec/helpers/commits_helper_spec.rb'
      ......
      ......@@ -88,10 +88,11 @@
      post :execute, params: { _json: multiplex }
      expect(response).to have_gitlab_http_status(:ok)
      expect(json_response).to eq([
      { 'data' => { '__typename' => 'Query' } },
      { 'data' => { '__typename' => 'Query' } }
      ])
      expect(json_response).to eq(
      [
      { 'data' => { '__typename' => 'Query' } },
      { 'data' => { '__typename' => 'Query' } }
      ])
      end
      it 'sets a limit on the total query size' do
      ......
      ......@@ -59,12 +59,13 @@
      expect(response).to have_gitlab_http_status(:ok)
      expect(response.headers['Content-Type']).to eq('text/csv; charset=utf-8')
      expect(csv_response).to eq([
      %w[date group_name coverage],
      ['2020-03-09', 'rspec', '79.0'],
      ['2020-03-08', 'rspec', '77.0'],
      ['2019-12-10', 'karma', '81.0']
      ])
      expect(csv_response).to eq(
      [
      %w[date group_name coverage],
      ['2020-03-09', 'rspec', '79.0'],
      ['2020-03-08', 'rspec', '77.0'],
      ['2019-12-10', 'karma', '81.0']
      ])
      end
      context 'when given date range spans more than 90 days' do
      ......@@ -72,12 +73,13 @@
      let(:end_date) { '2020-03-09' }
      it 'limits the result to 90 days from the given start_date' do
      expect(csv_response).to eq([
      %w[date group_name coverage],
      ['2020-03-09', 'rspec', '79.0'],
      ['2020-03-08', 'rspec', '77.0'],
      ['2019-12-10', 'karma', '81.0']
      ])
      expect(csv_response).to eq(
      [
      %w[date group_name coverage],
      ['2020-03-09', 'rspec', '79.0'],
      ['2020-03-08', 'rspec', '77.0'],
      ['2019-12-10', 'karma', '81.0']
      ])
      end
      end
      ......@@ -89,29 +91,8 @@
      it 'serves the results in JSON' do
      expect(response).to have_gitlab_http_status(:ok)
      expect(json_response).to eq([
      {
      'group_name' => 'rspec',
      'data' => [
      { 'date' => '2020-03-09', 'coverage' => 79.0 },
      { 'date' => '2020-03-08', 'coverage' => 77.0 }
      ]
      },
      {
      'group_name' => 'karma',
      'data' => [
      { 'date' => '2019-12-10', 'coverage' => 81.0 }
      ]
      }
      ])
      end
      context 'when given date range spans more than 90 days' do
      let(:start_date) { '2019-12-09' }
      let(:end_date) { '2020-03-09' }
      it 'limits the result to 90 days from the given start_date' do
      expect(json_response).to eq([
      expect(json_response).to eq(
      [
      {
      'group_name' => 'rspec',
      'data' => [
      ......@@ -126,6 +107,29 @@
      ]
      }
      ])
      end
      context 'when given date range spans more than 90 days' do
      let(:start_date) { '2019-12-09' }
      let(:end_date) { '2020-03-09' }
      it 'limits the result to 90 days from the given start_date' do
      expect(json_response).to eq(
      [
      {
      'group_name' => 'rspec',
      'data' => [
      { 'date' => '2020-03-09', 'coverage' => 79.0 },
      { 'date' => '2020-03-08', 'coverage' => 77.0 }
      ]
      },
      {
      'group_name' => 'karma',
      'data' => [
      { 'date' => '2019-12-10', 'coverage' => 81.0 }
      ]
      }
      ])
      end
      end
      ......
      ......@@ -143,10 +143,11 @@
      it_behaves_like 'returns a successful validation'
      it 'assigns result with errors' do
      expect(parsed_body['errors']).to match_array([
      'jobs rubocop config should implement a script: or a trigger: keyword',
      'jobs config should contain at least one visible job'
      ])
      expect(parsed_body['errors']).to match_array(
      [
      'jobs rubocop config should implement a script: or a trigger: keyword',
      'jobs config should contain at least one visible job'
      ])
      end
      context 'with dry_run mode' do
      ......
      ......@@ -86,11 +86,12 @@
      # Each test failure in this pipeline has a matching failure in the default branch
      recent_failures = json_response['test_cases'].map { |tc| tc['recent_failures'] }
      expect(recent_failures).to eq([
      { 'count' => 1, 'base_branch' => 'master' },
      { 'count' => 1, 'base_branch' => 'master' },
      { 'count' => 1, 'base_branch' => 'master' }
      ])
      expect(recent_failures).to eq(
      [
      { 'count' => 1, 'base_branch' => 'master' },
      { 'count' => 1, 'base_branch' => 'master' },
      { 'count' => 1, 'base_branch' => 'master' }
      ])
      end
      end
      end
      ......
      ......@@ -994,8 +994,8 @@ def post_request
      expect(response).to have_gitlab_http_status(:bad_request)
      expect(json_response['errors']).to eq([
      'test job: chosen stage does not exist; available stages are .pre, build, test, deploy, .post'
      ])
      'test job: chosen stage does not exist; available stages are .pre, build, test, deploy, .post'
      ])
      expect(json_response['warnings'][0]).to include(
      'jobs:build may allow multiple pipelines to run for a single action due to `rules:when`'
      )
      ......
      ......@@ -58,7 +58,7 @@ def self.kwargs_warning
      # See https://gitlab.com/gitlab-org/gitlab/-/commit/aea37f506bbe036378998916d374966c031bf347#note_647515736
      def self.allowed_kwarg_warning_paths
      %w[
      ]
      ]
      end
      def self.configure!
      ......
      ......@@ -12,10 +12,11 @@
      allow(Gitlab::Kas).to receive(:internal_url).and_return('kas.example.internal')
      allow_next_instance_of(Gitlab::Kas::Client) do |client|
      allow(client).to receive(:list_agent_config_files).and_return([
      double(agent_name: 'example-agent-1', path: '.gitlab/agents/example-agent-1/config.yaml'),
      double(agent_name: 'example-agent-2', path: '.gitlab/agents/example-agent-2/config.yaml')
      ])
      allow(client).to receive(:list_agent_config_files).and_return(
      [
      double(agent_name: 'example-agent-1', path: '.gitlab/agents/example-agent-1/config.yaml'),
      double(agent_name: 'example-agent-2', path: '.gitlab/agents/example-agent-2/config.yaml')
      ])
      allow(client).to receive(:get_connected_agents).and_return([])
      end
      ......
      ......@@ -88,10 +88,11 @@
      let(:order) { :asc }
      it 'returns entities sorted ascending' do
      expect(subject.execute).to eq([
      started_entity_1, finished_entity_1, failed_entity_1,
      started_entity_2, finished_entity_2, failed_entity_2
      ])
      expect(subject.execute).to eq(
      [
      started_entity_1, finished_entity_1, failed_entity_1,
      started_entity_2, finished_entity_2, failed_entity_2
      ])
      end
      end
      ......@@ -99,10 +100,11 @@
      let(:order) { :desc }
      it 'returns entities sorted descending' do
      expect(subject.execute).to eq([
      failed_entity_2, finished_entity_2, started_entity_2,
      failed_entity_1, finished_entity_1, started_entity_1
      ])
      expect(subject.execute).to eq(
      [
      failed_entity_2, finished_entity_2, started_entity_2,
      failed_entity_1, finished_entity_1, started_entity_1
      ])
      end
      end
      end
      ......
      ......@@ -50,12 +50,13 @@
      let(:current_user) { user_with_permission }
      it 'returns matching coverages within the given date range' do
      expect(coverages).to match_array([
      karma_coverage_2,
      rspec_coverage_2,
      karma_coverage_1,
      rspec_coverage_1
      ])
      expect(coverages).to match_array(
      [
      karma_coverage_2,
      rspec_coverage_2,
      karma_coverage_1,
      rspec_coverage_1
      ])
      end
      context 'when ref_path is nil' do
      ......@@ -73,10 +74,11 @@
      let(:limit) { 2 }
      it 'returns limited number of matching coverages within the given date range' do
      expect(coverages).to match_array([
      karma_coverage_2,
      rspec_coverage_2
      ])
      expect(coverages).to match_array(
      [
      karma_coverage_2,
      rspec_coverage_2
      ])
      end
      end
      ......
      ......@@ -30,24 +30,26 @@
      it 'returns all deploy tokens' do
      expect(subject.size).to eq(6)
      is_expected.to match_array([
      project_deploy_token,
      revoked_project_deploy_token,
      expired_project_deploy_token,
      group_deploy_token,
      revoked_group_deploy_token,
      expired_group_deploy_token
      ])
      is_expected.to match_array(
      [
      project_deploy_token,
      revoked_project_deploy_token,
      expired_project_deploy_token,
      group_deploy_token,
      revoked_group_deploy_token,
      expired_group_deploy_token
      ])
      end
      context 'and active filter is applied' do
      let(:params) { { active: true } }
      it 'returns only active tokens' do
      is_expected.to match_array([
      project_deploy_token,
      group_deploy_token
      ])
      is_expected.to match_array(
      [
      project_deploy_token,
      group_deploy_token
      ])
      end
      end
      ......@@ -68,11 +70,12 @@
      end
      it 'returns all deploy tokens for the project' do
      is_expected.to match_array([
      project_deploy_token,
      revoked_project_deploy_token,
      expired_project_deploy_token
      ])
      is_expected.to match_array(
      [
      project_deploy_token,
      revoked_project_deploy_token,
      expired_project_deploy_token
      ])
      end
      context 'and active filter is applied' do
      ......@@ -100,11 +103,12 @@
      end
      it 'returns all deploy tokens for the group' do
      is_expected.to match_array([
      group_deploy_token,
      revoked_group_deploy_token,
      expired_group_deploy_token
      ])
      is_expected.to match_array(
      [
      group_deploy_token,
      revoked_group_deploy_token,
      expired_group_deploy_token
      ])
      end
      context 'and active filter is applied' do
      ......
      ......@@ -54,14 +54,14 @@
      it 'includes only the expected projects' do
      expected_projects = Project.id_in(
      [
      project_b_subgroup_1, # direct member of Group B gets access to this project due to group hierarchy
      project_b_subgroup_2, # direct member of Group B gets access to this project due to group hierarchy
      project_c, # direct member of Group B gets access to this project via project-group share
      project_a_subgroup_1, # direct member of Group B gets access to this project via group share
      project_a_subgroup_2, # direct member of Group B gets access to this project via group share
      project_b_subgroup_1, # direct member of Group B gets access to this project due to group hierarchy
      project_b_subgroup_2, # direct member of Group B gets access to this project due to group hierarchy
      project_c, # direct member of Group B gets access to this project via project-group share
      project_a_subgroup_1, # direct member of Group B gets access to this project via group share
      project_a_subgroup_2, # direct member of Group B gets access to this project via group share
      # direct member of Group B gets access to any projects shared with groups within its shared groups.
      project_x_subgroup_1
      # direct member of Group B gets access to any projects shared with groups within its shared groups.
      project_x_subgroup_1
      ]
      )
      # project_c_subgroup_1 is not included in the list because only 'direct' members of
      ......
      ......@@ -46,9 +46,9 @@
      it 'includes only the expected projects' do
      expected_projects = Project.id_in(
      [
      project_b_subgroup_1,
      project_b_subgroup_2,
      project_c
      project_b_subgroup_1,
      project_b_subgroup_2,
      project_c
      ]
      )
      ......
      ......@@ -23,40 +23,41 @@
      let(:namespace) { create(:namespace, name: 'frontend-fixtures') }
      let(:project) { create(:project, :public, :repository, namespace: namespace, path: 'search-project') }
      let(:blobs) do
      Kaminari.paginate_array([
      Gitlab::Search::FoundBlob.new(
      path: 'CHANGELOG',
      basename: 'CHANGELOG',
      ref: 'master',
      data: "hello\nworld\nfoo\nSend # this is the highligh\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2),
      Gitlab::Search::FoundBlob.new(
      path: 'CONTRIBUTING',
      basename: 'CONTRIBUTING',
      ref: 'master',
      data: "hello\nworld\nfoo\nSend # this is the highligh\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2),
      Gitlab::Search::FoundBlob.new(
      path: 'README',
      basename: 'README',
      ref: 'master',
      data: "foo\nSend # this is the highlight\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2),
      Gitlab::Search::FoundBlob.new(
      path: 'test',
      basename: 'test',
      ref: 'master',
      data: "foo\nSend # this is the highlight\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2)
      ],
      Kaminari.paginate_array(
      [
      Gitlab::Search::FoundBlob.new(
      path: 'CHANGELOG',
      basename: 'CHANGELOG',
      ref: 'master',
      data: "hello\nworld\nfoo\nSend # this is the highligh\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2),
      Gitlab::Search::FoundBlob.new(
      path: 'CONTRIBUTING',
      basename: 'CONTRIBUTING',
      ref: 'master',
      data: "hello\nworld\nfoo\nSend # this is the highligh\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2),
      Gitlab::Search::FoundBlob.new(
      path: 'README',
      basename: 'README',
      ref: 'master',
      data: "foo\nSend # this is the highlight\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2),
      Gitlab::Search::FoundBlob.new(
      path: 'test',
      basename: 'test',
      ref: 'master',
      data: "foo\nSend # this is the highlight\nbaz\nboo\nbat",
      project: project,
      project_id: project.id,
      startline: 2)
      ],
      total_count: 4,
      limit: 4,
      offset: 0)
      ......
      ......@@ -43,11 +43,12 @@
      end
      it 'returns notice about feature removal' do
      expect(subject[:errors]).to match_array([
      'This endpoint was deactivated as part of the certificate-based' \
      'kubernetes integration removal. See Epic:' \
      'https://gitlab.com/groups/gitlab-org/configure/-/epics/8'
      ])
      expect(subject[:errors]).to match_array(
      [
      'This endpoint was deactivated as part of the certificate-based' \
      'kubernetes integration removal. See Epic:' \
      'https://gitlab.com/groups/gitlab-org/configure/-/epics/8'
      ])
      end
      end
      end
      ......
      ......@@ -32,11 +32,12 @@
      # Each test failure in this pipeline has a matching failure in the default branch
      recent_failures = test_suite[:test_cases].map { |tc| tc[:recent_failures] }
      expect(recent_failures).to eq([
      { count: 1, base_branch: 'master' },
      { count: 1, base_branch: 'master' },
      { count: 1, base_branch: 'master' }
      ])
      expect(recent_failures).to eq(
      [
      { count: 1, base_branch: 'master' },
      { count: 1, base_branch: 'master' },
      { count: 1, base_branch: 'master' }
      ])
      end
      end
      ......
      ......@@ -7,8 +7,8 @@
      it 'exposes the expected fields' do
      expected_fields = %i[
      name
      download_location
      name
      download_location
      ]
      expect(described_class).to have_graphql_fields(*expected_fields)
      ......
      ......@@ -7,9 +7,9 @@
      it 'exposes the expected fields' do
      expected_fields = %i[
      name
      human_readable_name
      architectures
      name
      human_readable_name
      architectures
      ]
      expect(described_class).to have_graphql_fields(*expected_fields)
      ......
      ......@@ -7,8 +7,8 @@
      it 'has the expected fields' do
      expected_fields = %w[
      path annotations schema_validation_warnings
      ]
      path annotations schema_validation_warnings
      ]
      expect(described_class).to have_graphql_fields(*expected_fields)
      end
      ......
      ......@@ -5,7 +5,7 @@
      RSpec.describe GitlabSchema.types['ComposerMetadata'] do
      it 'includes composer metadatum fields' do
      expected_fields = %w[
      target_sha composer_json
      target_sha composer_json
      ]
      expect(described_class).to include_graphql_fields(*expected_fields)
      ......
      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