From f0a6af8492fdc885e4ce7bcb42f581262b040b69 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Mon, 25 Feb 2019 00:26:22 +0200 Subject: [PATCH] rubocop: fix offences of the Layout/EmptyLinesAroundModuleBody cop --- .rubocop_todo.yml | 16 ---------------- lib/pry/commands/ls/interrogatable.rb | 2 -- lib/pry/commands/ls/jruby_hacks.rb | 2 -- lib/pry/commands/ls/methods_helper.rb | 2 -- lib/pry/helpers/command_helpers.rb | 2 -- lib/pry/helpers/documentation_helpers.rb | 1 - lib/pry/helpers/table.rb | 1 - lib/pry/rubygem.rb | 2 -- spec/commands/show_doc_spec.rb | 2 -- spec/commands/show_source_spec.rb | 1 - 10 files changed, 31 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index de781467..4f5c3665 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -13,22 +13,6 @@ Gemspec/RequiredRubyVersion: Exclude: - 'pry.gemspec' -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines -Layout/EmptyLinesAroundModuleBody: - Exclude: - - 'lib/pry/commands/ls/interrogatable.rb' - - 'lib/pry/commands/ls/jruby_hacks.rb' - - 'lib/pry/commands/ls/methods_helper.rb' - - 'lib/pry/helpers/command_helpers.rb' - - 'lib/pry/helpers/documentation_helpers.rb' - - 'lib/pry/helpers/table.rb' - - 'lib/pry/rubygem.rb' - - 'spec/commands/show_doc_spec.rb' - - 'spec/commands/show_source_spec.rb' - # Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. diff --git a/lib/pry/commands/ls/interrogatable.rb b/lib/pry/commands/ls/interrogatable.rb index 5904d1b4..66a4aa45 100644 --- a/lib/pry/commands/ls/interrogatable.rb +++ b/lib/pry/commands/ls/interrogatable.rb @@ -1,5 +1,4 @@ module Pry::Command::Ls::Interrogatable - private def interrogating_a_module? @@ -14,5 +13,4 @@ module Pry::Command::Ls::Interrogatable singleton.ancestors.grep(::Class).reject { |c| c == singleton }.first end end - end diff --git a/lib/pry/commands/ls/jruby_hacks.rb b/lib/pry/commands/ls/jruby_hacks.rb index 449fd089..ef471735 100644 --- a/lib/pry/commands/ls/jruby_hacks.rb +++ b/lib/pry/commands/ls/jruby_hacks.rb @@ -1,5 +1,4 @@ module Pry::Command::Ls::JRubyHacks - private # JRuby creates lots of aliases for methods imported from java in an attempt @@ -45,5 +44,4 @@ module Pry::Command::Ls::JRubyHacks end end.inject(&:+) + (name.size / 100.0) end - end diff --git a/lib/pry/commands/ls/methods_helper.rb b/lib/pry/commands/ls/methods_helper.rb index 88fde051..c819ab03 100644 --- a/lib/pry/commands/ls/methods_helper.rb +++ b/lib/pry/commands/ls/methods_helper.rb @@ -1,7 +1,6 @@ require 'pry/commands/ls/jruby_hacks' module Pry::Command::Ls::MethodsHelper - include Pry::Command::Ls::JRubyHacks private @@ -42,5 +41,4 @@ module Pry::Command::Ls::MethodsHelper end end end - end diff --git a/lib/pry/helpers/command_helpers.rb b/lib/pry/helpers/command_helpers.rb index 68fa5f19..209ae49a 100644 --- a/lib/pry/helpers/command_helpers.rb +++ b/lib/pry/helpers/command_helpers.rb @@ -1,6 +1,5 @@ class Pry module Helpers - module CommandHelpers include OptionsHelpers @@ -152,6 +151,5 @@ class Pry _pry_.inject_local("_dir_", _pry_.last_dir, target) end end - end end diff --git a/lib/pry/helpers/documentation_helpers.rb b/lib/pry/helpers/documentation_helpers.rb index d7393eeb..d289a4fe 100644 --- a/lib/pry/helpers/documentation_helpers.rb +++ b/lib/pry/helpers/documentation_helpers.rb @@ -1,6 +1,5 @@ class Pry module Helpers - # This class contains methods useful for extracting # documentation from methods and classes. module DocumentationHelpers diff --git a/lib/pry/helpers/table.rb b/lib/pry/helpers/table.rb index bd25bd84..410d0b03 100644 --- a/lib/pry/helpers/table.rb +++ b/lib/pry/helpers/table.rb @@ -110,6 +110,5 @@ class Pry @colorless_cache[thing] end end - end end diff --git a/lib/pry/rubygem.rb b/lib/pry/rubygem.rb index 9b3e13b7..c52587f7 100644 --- a/lib/pry/rubygem.rb +++ b/lib/pry/rubygem.rb @@ -2,7 +2,6 @@ require 'rubygems' class Pry module Rubygem - class << self def installed?(name) if Gem::Specification.respond_to?(:find_all_by_name) @@ -79,6 +78,5 @@ class Pry Gem.refresh end end - end end diff --git a/spec/commands/show_doc_spec.rb b/spec/commands/show_doc_spec.rb index a7c50902..473e02b5 100644 --- a/spec/commands/show_doc_spec.rb +++ b/spec/commands/show_doc_spec.rb @@ -356,7 +356,6 @@ describe "show-doc" do describe "when no class/module arg is given" do before do module TestHost - # hello there froggy module M def d; end @@ -530,7 +529,6 @@ describe "show-doc" do describe "for modules" do before do module Jesus - # alpha-doc module Alpha def alpha; :alpha; end diff --git a/spec/commands/show_source_spec.rb b/spec/commands/show_source_spec.rb index de7a7ec9..c97a0577 100644 --- a/spec/commands/show_source_spec.rb +++ b/spec/commands/show_source_spec.rb @@ -611,7 +611,6 @@ describe "show-source" do describe "should skip over broken modules" do before do module BabyDuck - module Muesli binding.eval("def a; end", "dummy.rb", 1) binding.eval("def b; end", "dummy.rb", 2)