Autofix Rubocop Style/BlockDelimiters (#23706)
This commit is contained in:
parent
c0d7c855b3
commit
167709f6b0
4 changed files with 18 additions and 31 deletions
|
@ -2686,19 +2686,6 @@ Security/IoMethods:
|
||||||
- 'spec/controllers/admin/export_domain_allows_controller_spec.rb'
|
- 'spec/controllers/admin/export_domain_allows_controller_spec.rb'
|
||||||
- 'spec/controllers/admin/export_domain_blocks_controller_spec.rb'
|
- 'spec/controllers/admin/export_domain_blocks_controller_spec.rb'
|
||||||
|
|
||||||
# Offense count: 9
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
|
||||||
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
|
||||||
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
|
||||||
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
||||||
# FunctionalMethods: let, let!, subject, watch
|
|
||||||
# AllowedMethods: lambda, proc, it
|
|
||||||
Style/BlockDelimiters:
|
|
||||||
Exclude:
|
|
||||||
- 'db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb'
|
|
||||||
- 'spec/controllers/settings/applications_controller_spec.rb'
|
|
||||||
- 'spec/lib/webfinger_resource_spec.rb'
|
|
||||||
|
|
||||||
# Offense count: 5
|
# Offense count: 5
|
||||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||||
Style/CaseLikeIf:
|
Style/CaseLikeIf:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class AddVisibleInPickerToCustomEmoji < ActiveRecord::Migration[5.1]
|
class AddVisibleInPickerToCustomEmoji < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
safety_assured {
|
safety_assured do
|
||||||
add_column :custom_emojis, :visible_in_picker, :boolean, default: true, null: false
|
add_column :custom_emojis, :visible_in_picker, :boolean, default: true, null: false
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -112,11 +112,11 @@ describe Settings::ApplicationsController do
|
||||||
|
|
||||||
describe 'PATCH #update' do
|
describe 'PATCH #update' do
|
||||||
context 'success' do
|
context 'success' do
|
||||||
let(:opts) {
|
let(:opts) do
|
||||||
{
|
{
|
||||||
website: 'https://foo.bar/',
|
website: 'https://foo.bar/',
|
||||||
}
|
}
|
||||||
}
|
end
|
||||||
|
|
||||||
def call_update
|
def call_update
|
||||||
patch :update, params: {
|
patch :update, params: {
|
||||||
|
|
|
@ -14,9 +14,9 @@ describe WebfingerResource do
|
||||||
it 'raises with a route whose controller is not AccountsController' do
|
it 'raises with a route whose controller is not AccountsController' do
|
||||||
resource = 'https://example.com/users/alice/other'
|
resource = 'https://example.com/users/alice/other'
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(ActiveRecord::RecordNotFound)
|
end.to raise_error(ActiveRecord::RecordNotFound)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'raises with a route whose action is not show' do
|
it 'raises with a route whose action is not show' do
|
||||||
|
@ -29,17 +29,17 @@ describe WebfingerResource do
|
||||||
|
|
||||||
expect(Rails.application.routes).to receive(:recognize_path).with(resource).and_return(recognized).at_least(:once)
|
expect(Rails.application.routes).to receive(:recognize_path).with(resource).and_return(recognized).at_least(:once)
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(ActiveRecord::RecordNotFound)
|
end.to raise_error(ActiveRecord::RecordNotFound)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'raises with a string that doesnt start with URL' do
|
it 'raises with a string that doesnt start with URL' do
|
||||||
resource = 'website for http://example.com/users/alice/other'
|
resource = 'website for http://example.com/users/alice/other'
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(WebfingerResource::InvalidRequest)
|
end.to raise_error(WebfingerResource::InvalidRequest)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'finds the username in a valid https route' do
|
it 'finds the username in a valid https route' do
|
||||||
|
@ -68,9 +68,9 @@ describe WebfingerResource do
|
||||||
it 'raises on a non-local domain' do
|
it 'raises on a non-local domain' do
|
||||||
resource = 'user@remote-host.com'
|
resource = 'user@remote-host.com'
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(ActiveRecord::RecordNotFound)
|
end.to raise_error(ActiveRecord::RecordNotFound)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'finds username for a local domain' do
|
it 'finds username for a local domain' do
|
||||||
|
@ -94,17 +94,17 @@ describe WebfingerResource do
|
||||||
it 'raises on a non-local domain' do
|
it 'raises on a non-local domain' do
|
||||||
resource = 'acct:user@remote-host.com'
|
resource = 'acct:user@remote-host.com'
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(ActiveRecord::RecordNotFound)
|
end.to raise_error(ActiveRecord::RecordNotFound)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'raises on a nonsense domain' do
|
it 'raises on a nonsense domain' do
|
||||||
resource = 'acct:user@remote-host@remote-hostess.remote.local@remote'
|
resource = 'acct:user@remote-host@remote-hostess.remote.local@remote'
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(ActiveRecord::RecordNotFound)
|
end.to raise_error(ActiveRecord::RecordNotFound)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'finds the username for a local account if the domain is the local one' do
|
it 'finds the username for a local account if the domain is the local one' do
|
||||||
|
@ -128,9 +128,9 @@ describe WebfingerResource do
|
||||||
it 'raises InvalidRequest' do
|
it 'raises InvalidRequest' do
|
||||||
resource = 'df/:dfkj'
|
resource = 'df/:dfkj'
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
WebfingerResource.new(resource).username
|
WebfingerResource.new(resource).username
|
||||||
}.to raise_error(WebfingerResource::InvalidRequest)
|
end.to raise_error(WebfingerResource::InvalidRequest)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue