Autofix Rubocop Style/TrailingCommaInArrayLiteral (#23692)

This commit is contained in:
Nick Schonning 2023-02-18 16:54:30 -05:00 committed by GitHub
parent 5069769cbe
commit 08289a38fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 22 deletions

View File

@ -3405,18 +3405,6 @@ Style/SymbolProc:
Exclude: Exclude:
- 'spec/lib/request_spec.rb' - 'spec/lib/request_spec.rb'
# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'spec/helpers/jsonld_helper_spec.rb'
- 'spec/lib/extractor_spec.rb'
- 'spec/services/activitypub/process_account_service_spec.rb'
- 'spec/services/activitypub/process_collection_service_spec.rb'
- 'spec/workers/activitypub/move_distribution_worker_spec.rb'
# Offense count: 4 # Offense count: 4
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
Style/UnpackFirst: Style/UnpackFirst:

View File

@ -113,7 +113,7 @@ describe JsonLdHelper do
{ {
'type' => 'Mention', 'type' => 'Mention',
'href' => ['foo'], 'href' => ['foo'],
} },
], ],
}, },
'signature' => { 'signature' => {

View File

@ -20,7 +20,7 @@ describe Extractor do
text = '@screen_name' text = '@screen_name'
extracted = Extractor.extract_mentions_or_lists_with_indices(text) extracted = Extractor.extract_mentions_or_lists_with_indices(text)
expect(extracted).to eq [ expect(extracted).to eq [
{ screen_name: 'screen_name', indices: [0, 12] } { screen_name: 'screen_name', indices: [0, 12] },
] ]
end end

View File

@ -173,7 +173,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
type: 'Mention', type: 'Mention',
href: "https://foo.test/users/#{i + 1}", href: "https://foo.test/users/#{i + 1}",
name: "@user#{i + 1}", name: "@user#{i + 1}",
} },
], ],
to: ['as:Public', "https://foo.test/users/#{i + 1}"], to: ['as:Public', "https://foo.test/users/#{i + 1}"],
}.with_indifferent_access }.with_indifferent_access

View File

@ -107,17 +107,17 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
'@context': [ '@context': [
'https://www.w3.org/ns/activitystreams', 'https://www.w3.org/ns/activitystreams',
nil, nil,
{ object: 'https://www.w3.org/ns/activitystreams#object' } { object: 'https://www.w3.org/ns/activitystreams#object' },
], ],
id: 'https://example.com/users/bob/fake-status/activity', id: 'https://example.com/users/bob/fake-status/activity',
type: 'Create', type: 'Create',
actor: 'https://example.com/users/bob', actor: 'https://example.com/users/bob',
published: '2022-01-22T15:00:00Z', published: '2022-01-22T15:00:00Z',
to: [ to: [
'https://www.w3.org/ns/activitystreams#Public' 'https://www.w3.org/ns/activitystreams#Public',
], ],
cc: [ cc: [
'https://example.com/users/bob/followers' 'https://example.com/users/bob/followers',
], ],
signature: { signature: {
type: 'RsaSignature2017', type: 'RsaSignature2017',
@ -140,10 +140,10 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=puck-was-here', url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=puck-was-here',
attributedTo: 'https://example.com/users/bob', attributedTo: 'https://example.com/users/bob',
to: [ to: [
'https://www.w3.org/ns/activitystreams#Public' 'https://www.w3.org/ns/activitystreams#Public',
], ],
cc: [ cc: [
'https://example.com/users/bob/followers' 'https://example.com/users/bob/followers',
], ],
sensitive: false, sensitive: false,
atomUri: 'https://example.com/users/bob/fake-status', atomUri: 'https://example.com/users/bob/fake-status',
@ -166,7 +166,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
{ {
'@value': '<p>hello world</p>', '@value': '<p>hello world</p>',
'@language': 'en', '@language': 'en',
} },
], ],
'https://www.w3.org/ns/activitystreams#published': { 'https://www.w3.org/ns/activitystreams#published': {
'@type': 'http://www.w3.org/2001/XMLSchema#dateTime', '@type': 'http://www.w3.org/2001/XMLSchema#dateTime',

View File

@ -16,7 +16,7 @@ describe ActivityPub::MoveDistributionWorker do
it 'delivers to followers and known blockers' do it 'delivers to followers and known blockers' do
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [ expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [
[kind_of(String), migration.account.id, 'http://example.com'], [kind_of(String), migration.account.id, 'http://example.com'],
[kind_of(String), migration.account.id, 'http://example2.com'] [kind_of(String), migration.account.id, 'http://example2.com'],
]) ])
subject.perform(migration.id) subject.perform(migration.id)
end end