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:
parent
2724914239
commit
be89e84ae3
6 changed files with 6 additions and 15 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue