1
0

Fix Rails/Output cop (#24687)

This commit is contained in:
Matt Jankowski 2023-04-30 00:48:16 -04:00 committed by GitHub
parent 5a2aa06a51
commit 2e43461100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View File

@ -1388,13 +1388,6 @@ Rails/NegateInclude:
- 'app/workers/web/push_notification_worker.rb' - 'app/workers/web/push_notification_worker.rb'
- 'lib/paperclip/color_extractor.rb' - 'lib/paperclip/color_extractor.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Rails/Output:
Exclude:
- 'lib/mastodon/ip_blocks_cli.rb'
Rails/OutputSafety: Rails/OutputSafety:
Exclude: Exclude:
- 'config/initializers/simple_form.rb' - 'config/initializers/simple_form.rb'

View File

@ -108,9 +108,9 @@ module Mastodon
IpBlock.where(severity: :no_access).find_each do |ip_block| IpBlock.where(severity: :no_access).find_each do |ip_block|
case options[:format] case options[:format]
when 'nginx' when 'nginx'
puts "deny #{ip_block.ip}/#{ip_block.ip.prefix};" say "deny #{ip_block.ip}/#{ip_block.ip.prefix};"
else else
puts "#{ip_block.ip}/#{ip_block.ip.prefix}" say "#{ip_block.ip}/#{ip_block.ip.prefix}"
end end
end end
end end