Autofix Rubocop Style/TrailingCommaInHashLiteral (#23693)
parent
2f54d6f33c
commit
4dc470fbee
|
@ -3417,34 +3417,6 @@ Style/TrailingCommaInArrayLiteral:
|
|||
- 'spec/services/activitypub/process_collection_service_spec.rb'
|
||||
- 'spec/workers/activitypub/move_distribution_worker_spec.rb'
|
||||
|
||||
# Offense count: 61
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyleForMultiline.
|
||||
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
||||
Style/TrailingCommaInHashLiteral:
|
||||
Exclude:
|
||||
- 'spec/controllers/admin/accounts_controller_spec.rb'
|
||||
- 'spec/controllers/admin/domain_blocks_controller_spec.rb'
|
||||
- 'spec/controllers/api/v1/accounts/credentials_controller_spec.rb'
|
||||
- 'spec/controllers/api/v1/push/subscriptions_controller_spec.rb'
|
||||
- 'spec/controllers/api/web/push_subscriptions_controller_spec.rb'
|
||||
- 'spec/controllers/settings/applications_controller_spec.rb'
|
||||
- 'spec/controllers/settings/imports_controller_spec.rb'
|
||||
- 'spec/controllers/settings/preferences/notifications_controller_spec.rb'
|
||||
- 'spec/controllers/settings/preferences/other_controller_spec.rb'
|
||||
- 'spec/lib/activitypub/activity/announce_spec.rb'
|
||||
- 'spec/lib/activitypub/activity/create_spec.rb'
|
||||
- 'spec/services/activitypub/fetch_featured_collection_service_spec.rb'
|
||||
- 'spec/services/activitypub/fetch_featured_tags_collection_service_spec.rb'
|
||||
- 'spec/services/activitypub/fetch_remote_status_service_spec.rb'
|
||||
- 'spec/services/activitypub/fetch_replies_service_spec.rb'
|
||||
- 'spec/services/activitypub/process_account_service_spec.rb'
|
||||
- 'spec/services/activitypub/process_collection_service_spec.rb'
|
||||
- 'spec/services/activitypub/process_status_update_service_spec.rb'
|
||||
- 'spec/services/activitypub/synchronize_followers_service_spec.rb'
|
||||
- 'spec/services/fetch_resource_service_spec.rb'
|
||||
- 'spec/spec_helper.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/UnpackFirst:
|
||||
|
|
|
@ -39,7 +39,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
|
|||
username: 'username',
|
||||
display_name: 'display name',
|
||||
email: 'local-part@domain',
|
||||
ip: '0.0.0.42'
|
||||
ip: '0.0.0.42',
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
|
|||
domain_blocks_attributes: {
|
||||
'0' => { enabled: '1', domain: 'example.com', severity: 'silence' },
|
||||
'1' => { enabled: '0', domain: 'mastodon.social', severity: 'suspend' },
|
||||
'2' => { enabled: '1', domain: 'mastodon.online', severity: 'suspend' }
|
||||
}
|
||||
}
|
||||
'2' => { enabled: '1', domain: 'mastodon.online', severity: 'suspend' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
expect(DomainBlockWorker).to have_received(:perform_async).exactly(2).times
|
||||
|
|
|
@ -35,7 +35,7 @@ describe Api::V1::Accounts::CredentialsController do
|
|||
source: {
|
||||
privacy: 'unlisted',
|
||||
sensitive: true,
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ describe Api::V1::Push::SubscriptionsController do
|
|||
p256dh: 'BEm_a0bdPDhf0SOsrnB2-ategf1hHoCnpXgQsFj5JCkcoMrMt2WHoPfEYOYPzOIs9mZE8ZUaD7VA5vouy0kEkr8=',
|
||||
auth: 'eH_C8rq2raXqlcBVDa1gLg==',
|
||||
},
|
||||
}
|
||||
},
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
|
@ -37,8 +37,8 @@ describe Api::V1::Push::SubscriptionsController do
|
|||
mention: false,
|
||||
poll: true,
|
||||
status: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ describe Api::Web::PushSubscriptionsController do
|
|||
p256dh: 'BEm_a0bdPDhf0SOsrnB2-ategf1hHoCnpXgQsFj5JCkcoMrMt2WHoPfEYOYPzOIs9mZE8ZUaD7VA5vouy0kEkr8=',
|
||||
auth: 'eH_C8rq2raXqlcBVDa1gLg==',
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -32,8 +32,8 @@ describe Api::Web::PushSubscriptionsController do
|
|||
mention: false,
|
||||
poll: true,
|
||||
status: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ describe Settings::ApplicationsController do
|
|||
name: 'My New App',
|
||||
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
||||
website: 'http://google.com',
|
||||
scopes: 'read write follow'
|
||||
}
|
||||
scopes: 'read write follow',
|
||||
},
|
||||
}
|
||||
response
|
||||
end
|
||||
|
@ -73,8 +73,8 @@ describe Settings::ApplicationsController do
|
|||
name: 'My New App',
|
||||
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
||||
website: 'http://google.com',
|
||||
scopes: ['read', 'write', 'follow']
|
||||
}
|
||||
scopes: ['read', 'write', 'follow'],
|
||||
},
|
||||
}
|
||||
response
|
||||
end
|
||||
|
@ -95,8 +95,8 @@ describe Settings::ApplicationsController do
|
|||
name: '',
|
||||
redirect_uri: '',
|
||||
website: '',
|
||||
scopes: []
|
||||
}
|
||||
scopes: [],
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -114,14 +114,14 @@ describe Settings::ApplicationsController do
|
|||
context 'success' do
|
||||
let(:opts) {
|
||||
{
|
||||
website: 'https://foo.bar/'
|
||||
website: 'https://foo.bar/',
|
||||
}
|
||||
}
|
||||
|
||||
def call_update
|
||||
patch :update, params: {
|
||||
id: app.id,
|
||||
doorkeeper_application: opts
|
||||
doorkeeper_application: opts,
|
||||
}
|
||||
response
|
||||
end
|
||||
|
@ -144,8 +144,8 @@ describe Settings::ApplicationsController do
|
|||
name: '',
|
||||
redirect_uri: '',
|
||||
website: '',
|
||||
scopes: []
|
||||
}
|
||||
scopes: [],
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ RSpec.describe Settings::ImportsController, type: :controller do
|
|||
post :create, params: {
|
||||
import: {
|
||||
type: 'following',
|
||||
data: fixture_file_upload('imports.txt')
|
||||
}
|
||||
data: fixture_file_upload('imports.txt'),
|
||||
},
|
||||
}
|
||||
|
||||
expect(response).to redirect_to(settings_import_path)
|
||||
|
@ -34,8 +34,8 @@ RSpec.describe Settings::ImportsController, type: :controller do
|
|||
post :create, params: {
|
||||
import: {
|
||||
type: 'blocking',
|
||||
data: fixture_file_upload('imports.txt')
|
||||
}
|
||||
data: fixture_file_upload('imports.txt'),
|
||||
},
|
||||
}
|
||||
|
||||
expect(response).to redirect_to(settings_import_path)
|
||||
|
|
|
@ -25,7 +25,7 @@ describe Settings::Preferences::NotificationsController do
|
|||
user: {
|
||||
notification_emails: { follow: '1' },
|
||||
interactions: { must_be_follower: '0' },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
expect(response).to redirect_to(settings_preferences_notifications_path)
|
||||
|
|
|
@ -34,7 +34,7 @@ describe Settings::Preferences::OtherController do
|
|||
user: {
|
||||
setting_boost_modal: '1',
|
||||
setting_delete_modal: '0',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
expect(response).to redirect_to(settings_preferences_other_path)
|
||||
|
|
|
@ -85,7 +85,7 @@ RSpec.describe ActivityPub::Activity::Announce do
|
|||
type: 'OrderedCollection',
|
||||
id: 'http://example.com/followers',
|
||||
first: 'http://example.com/followers?page=true',
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
type: 'OrderedCollection',
|
||||
id: 'http://example.com/followers',
|
||||
first: 'http://example.com/followers?page=true',
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -686,7 +686,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
replies: {
|
||||
type: 'Collection',
|
||||
totalItems: 3,
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||
type: 'Note',
|
||||
name: 'Yellow',
|
||||
inReplyTo: ActivityPub::TagManager.instance.uri_for(local_status)
|
||||
inReplyTo: ActivityPub::TagManager.instance.uri_for(local_status),
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -741,7 +741,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||
type: 'Note',
|
||||
name: 'Yellow',
|
||||
inReplyTo: ActivityPub::TagManager.instance.uri_for(local_status)
|
||||
inReplyTo: ActivityPub::TagManager.instance.uri_for(local_status),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ RSpec.describe ActivityPub::FetchFeaturedCollectionService, type: :service do
|
|||
type: 'CollectionPage',
|
||||
partOf: actor.featured_collection_url,
|
||||
items: items,
|
||||
}
|
||||
},
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ RSpec.describe ActivityPub::FetchFeaturedTagsCollectionService, type: :service d
|
|||
type: 'CollectionPage',
|
||||
partOf: collection_url,
|
||||
items: items,
|
||||
}
|
||||
},
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
|
|||
id: "https://foo.bar/@foo/1234",
|
||||
type: 'Event',
|
||||
name: "Let's change the world",
|
||||
attributedTo: ActivityPub::TagManager.instance.uri_for(sender)
|
||||
attributedTo: ActivityPub::TagManager.instance.uri_for(sender),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ RSpec.describe ActivityPub::FetchRepliesService, type: :service do
|
|||
type: 'CollectionPage',
|
||||
partOf: collection_uri,
|
||||
items: items,
|
||||
}
|
||||
},
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
|
|||
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
|
||||
featured_json = {
|
||||
'@context': ['https://www.w3.org/ns/activitystreams'],
|
||||
|
|
|
@ -123,15 +123,15 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
|
|||
type: 'RsaSignature2017',
|
||||
creator: 'https://example.com/users/bob#main-key',
|
||||
created: '2022-03-09T21:57:25Z',
|
||||
signatureValue: 'WculK0LelTQ0MvGwU9TPoq5pFzFfGYRDCJqjZ232/Udj4CHqDTGOSw5UTDLShqBOyycCkbZGrQwXG+dpyDpQLSe1UVPZ5TPQtc/9XtI57WlS2nMNpdvRuxGnnb2btPdesXZ7n3pCxo0zjaXrJMe0mqQh5QJO22mahb4bDwwmfTHgbD3nmkD+fBfGi+UV2qWwqr+jlV4L4JqNkh0gWljF5KTePLRRZCuWiQ/FAt7c67636cdIPf7fR+usjuZltTQyLZKEGuK8VUn2Gkfsx5qns7Vcjvlz1JqlAjyO8HPBbzTTHzUG2nUOIgC3PojCSWv6mNTmRGoLZzOscCAYQA6cKw=='
|
||||
signatureValue: 'WculK0LelTQ0MvGwU9TPoq5pFzFfGYRDCJqjZ232/Udj4CHqDTGOSw5UTDLShqBOyycCkbZGrQwXG+dpyDpQLSe1UVPZ5TPQtc/9XtI57WlS2nMNpdvRuxGnnb2btPdesXZ7n3pCxo0zjaXrJMe0mqQh5QJO22mahb4bDwwmfTHgbD3nmkD+fBfGi+UV2qWwqr+jlV4L4JqNkh0gWljF5KTePLRRZCuWiQ/FAt7c67636cdIPf7fR+usjuZltTQyLZKEGuK8VUn2Gkfsx5qns7Vcjvlz1JqlAjyO8HPBbzTTHzUG2nUOIgC3PojCSWv6mNTmRGoLZzOscCAYQA6cKw==',
|
||||
},
|
||||
'@id': 'https://example.com/users/bob/statuses/107928807471117876/activity',
|
||||
'@type': 'https://www.w3.org/ns/activitystreams#Create',
|
||||
'https://www.w3.org/ns/activitystreams#actor': {
|
||||
'@id': 'https://example.com/users/bob'
|
||||
'@id': 'https://example.com/users/bob',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#cc': {
|
||||
'@id': 'https://example.com/users/bob/followers'
|
||||
'@id': 'https://example.com/users/bob/followers',
|
||||
},
|
||||
object: {
|
||||
id: 'https://example.com/users/bob/fake-status',
|
||||
|
@ -156,21 +156,21 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
|
|||
'http://ostatus.org#conversation': 'tag:example.com,2022-03-09:objectId=15:objectType=Conversation',
|
||||
'https://www.w3.org/ns/activitystreams#attachment': [],
|
||||
'https://www.w3.org/ns/activitystreams#attributedTo': {
|
||||
'@id': 'https://example.com/users/bob'
|
||||
'@id': 'https://example.com/users/bob',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#cc': {
|
||||
'@id': 'https://example.com/users/bob/followers'
|
||||
'@id': 'https://example.com/users/bob/followers',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#content': [
|
||||
'<p>hello world</p>',
|
||||
{
|
||||
'@value': '<p>hello world</p>',
|
||||
'@language': 'en'
|
||||
'@language': 'en',
|
||||
}
|
||||
],
|
||||
'https://www.w3.org/ns/activitystreams#published': {
|
||||
'@type': 'http://www.w3.org/2001/XMLSchema#dateTime',
|
||||
'@value': '2022-03-09T21:55:07Z'
|
||||
'@value': '2022-03-09T21:55:07Z',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#replies': {
|
||||
'@id': 'https://example.com/users/bob/statuses/107928807471117876/replies',
|
||||
|
@ -179,29 +179,29 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
|
|||
'@type': 'https://www.w3.org/ns/activitystreams#CollectionPage',
|
||||
'https://www.w3.org/ns/activitystreams#items': [],
|
||||
'https://www.w3.org/ns/activitystreams#next': {
|
||||
'@id': 'https://example.com/users/bob/statuses/107928807471117876/replies?only_other_accounts=true&page=true'
|
||||
'@id': 'https://example.com/users/bob/statuses/107928807471117876/replies?only_other_accounts=true&page=true',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#partOf': {
|
||||
'@id': 'https://example.com/users/bob/statuses/107928807471117876/replies'
|
||||
}
|
||||
}
|
||||
'@id': 'https://example.com/users/bob/statuses/107928807471117876/replies',
|
||||
},
|
||||
},
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#sensitive': false,
|
||||
'https://www.w3.org/ns/activitystreams#tag': [],
|
||||
'https://www.w3.org/ns/activitystreams#to': {
|
||||
'@id': 'https://www.w3.org/ns/activitystreams#Public'
|
||||
'@id': 'https://www.w3.org/ns/activitystreams#Public',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#url': {
|
||||
'@id': 'https://example.com/@bob/107928807471117876'
|
||||
}
|
||||
'@id': 'https://example.com/@bob/107928807471117876',
|
||||
},
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#published': {
|
||||
'@type': 'http://www.w3.org/2001/XMLSchema#dateTime',
|
||||
'@value': '2022-03-09T21:55:07Z'
|
||||
'@value': '2022-03-09T21:55:07Z',
|
||||
},
|
||||
'https://www.w3.org/ns/activitystreams#to': {
|
||||
'@id': 'https://www.w3.org/ns/activitystreams#Public'
|
||||
}
|
||||
'@id': 'https://www.w3.org/ns/activitystreams#Public',
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
|
|||
account: account,
|
||||
multiple: false,
|
||||
hide_totals: false,
|
||||
expires_at: expiration
|
||||
expires_at: expiration,
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -166,7 +166,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
|
|||
account: account,
|
||||
multiple: false,
|
||||
hide_totals: false,
|
||||
expires_at: expiration
|
||||
expires_at: expiration,
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -342,7 +342,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
|
|||
updated: '2021-09-08T22:39:25Z',
|
||||
attachment: [
|
||||
{ type: 'Image', mediaType: 'image/png', url: 'https://example.com/foo.png' },
|
||||
]
|
||||
],
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -374,7 +374,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
|
|||
updated: '2021-09-08T22:39:25Z',
|
||||
attachment: [
|
||||
{ type: 'Image', mediaType: 'image/png', url: 'https://example.com/foo.png', name: 'A picture' },
|
||||
]
|
||||
],
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ RSpec.describe ActivityPub::SynchronizeFollowersService, type: :service do
|
|||
type: 'CollectionPage',
|
||||
partOf: collection_uri,
|
||||
items: items,
|
||||
}
|
||||
},
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ RSpec.describe FetchResourceService, type: :service do
|
|||
end
|
||||
|
||||
context 'when link header is present' do
|
||||
let(:headers) { { 'Link' => '<http://example.com/foo>; rel="alternate"; type="application/activity+json"', } }
|
||||
let(:headers) { { 'Link' => '<http://example.com/foo>; rel="alternate"; type="application/activity+json"' } }
|
||||
|
||||
it { is_expected.to eq [1, { prefetched_body: json, id: true }] }
|
||||
end
|
||||
|
|
|
@ -61,6 +61,6 @@ end
|
|||
def expect_push_bulk_to_match(klass, matcher)
|
||||
expect(Sidekiq::Client).to receive(:push_bulk).with(hash_including({
|
||||
"class" => klass,
|
||||
"args" => matcher
|
||||
"args" => matcher,
|
||||
}))
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue