1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

rubocop: fix offences of the Lint/HandleExceptions cop

This commit is contained in:
Kyrylo Silin 2019-03-04 00:05:33 +02:00
parent 2724914239
commit be89e84ae3
6 changed files with 6 additions and 15 deletions

View file

@ -13,15 +13,6 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'pry.gemspec'
# Offense count: 6
Lint/HandleExceptions:
Exclude:
- 'lib/pry/command.rb'
- 'lib/pry/commands/find_method.rb'
- 'lib/pry/commands/gist.rb'
- 'lib/pry/pager.rb'
- 'lib/pry/terminal.rb'
# Offense count: 1
Lint/Loop:
Exclude:

View file

@ -334,7 +334,7 @@ class Pry
"which conflicts with a #{collision_type}.\n\n"
)
end
rescue Pry::RescuableException
rescue Pry::RescuableException # rubocop:disable Lint/HandleExceptions
end
# Extract necessary information from a line that Command.matches? this

View file

@ -127,7 +127,7 @@ class Pry
begin
const = klass.const_get(name)
rescue RescuableException
rescue RescuableException # rubocop:disable Lint/HandleExceptions
# constant loading is an inexact science at the best of times,
# this often happens when a constant was .autoload? but someone
# tried to load it. It's now not .autoload? but will still raise

View file

@ -89,7 +89,7 @@ class Pry
begin
::Gist.copy(url)
message << ", which is now in the clipboard."
rescue ::Gist::ClipboardError
rescue ::Gist::ClipboardError # rubocop:disable Lint/HandleExceptions
end
output.puts message

View file

@ -33,7 +33,7 @@ class Pry
def open
pager = best_available
yield pager
rescue StopPaging
rescue StopPaging # rubocop:disable Lint/HandleExceptions
ensure
pager.close if pager
end

View file

@ -46,10 +46,10 @@ class Pry
if $stdout.respond_to?(:tty?) && $stdout.tty? && $stdout.respond_to?(:winsize)
$stdout.winsize
end
rescue Errno::EOPNOTSUPP
rescue Errno::EOPNOTSUPP # rubocop:disable Lint/HandleExceptions
# $stdout is probably a socket, which doesn't support #winsize.
end
rescue LoadError
rescue LoadError # rubocop:disable Lint/HandleExceptions
# They probably don't have the io/console stdlib or the io-console gem.
# We'll keep trying.
end