Commit c52a0383 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'autocorrect_keyword_warnings_3' into 'master'

[RUN ALL RSPEC] Autocorrect more keyword warnings

See merge request gitlab-org/gitlab!51514
parents 941340e8 6bb65d2e
......@@ -20,7 +20,7 @@ module Mutations
description: copy_field_description(Types::MergeRequestType, :description)
def resolve(args)
merge_request = authorized_find!(args.slice(:project_path, :iid))
merge_request = authorized_find!(**args.slice(:project_path, :iid))
attributes = args.slice(:title, :description, :target_branch).compact
::MergeRequests::UpdateService
......
......@@ -226,10 +226,10 @@ class BackportEnterpriseSchema < ActiveRecord::Migration[5.0]
end
end
def create_table_if_not_exists(name, *args, &block)
def create_table_if_not_exists(name, **args, &block)
return if table_exists?(name)
create_table(name, *args, &block)
create_table(name, **args, &block)
end
def add_concurrent_foreign_key(source, target, column:, on_delete: nil, name: nil)
......
......@@ -11,7 +11,7 @@ module GroupInviteMembers
result = Members::CreateService.new(current_user, invite_params).execute(group)
track_event('invite_members', { label: 'new_group_form' }) if result[:status] == :success
track_event('invite_members', label: 'new_group_form') if result[:status] == :success
end
def emails_param
......
......@@ -8,7 +8,7 @@ RSpec.describe Mutations::ComplianceManagement::Frameworks::Create do
let(:params) { valid_params }
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
subject { mutation.resolve(params) }
subject { mutation.resolve(**params) }
describe '#resolve' do
context 'feature is unlicensed' do
......@@ -84,7 +84,7 @@ RSpec.describe Mutations::ComplianceManagement::Frameworks::Create do
end
context 'framework parameters are invalid' do
subject { mutation.resolve(invalid_color_params) }
subject { mutation.resolve(**invalid_color_params) }
it 'does not create a new compliance framework' do
expect { subject }.not_to change { namespace.compliance_management_frameworks.count }
......
......@@ -15,7 +15,7 @@ RSpec.describe Mutations::IncidentManagement::OncallSchedule::Destroy do
end
describe '#resolve' do
subject(:resolve) { mutation_for(project, current_user).resolve(args) }
subject(:resolve) { mutation_for(project, current_user).resolve(**args) }
context 'user has access to project' do
before do
......
......@@ -55,7 +55,7 @@ RSpec.describe Gitlab::ApplicationContext do
specify do
# Build a hash that has all `provided_options` as keys, and `nil` as value
provided_values = provided_options.map { |key| [key, nil] }.to_h
context = described_class.new(provided_values)
context = described_class.new(**provided_values)
expect(context.to_lazy_hash.keys).to contain_exactly(*expected_context_keys)
end
......
......@@ -1165,9 +1165,9 @@ module Gitlab
Arel::Nodes::SqlLiteral.new(replace.to_sql)
end
def remove_foreign_key_if_exists(*args)
if foreign_key_exists?(*args)
remove_foreign_key(*args)
def remove_foreign_key_if_exists(...)
if foreign_key_exists?(...)
remove_foreign_key(...)
end
end
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Gitlab::Ci::Config::Entry::Variables do
let(:metadata) { {} }
subject { described_class.new(config, metadata) }
subject { described_class.new(config, **metadata) }
shared_examples 'valid config' do
describe '#value' do
......
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