Skip to content

Commit

Permalink
rubocop: fix offences of the Layout/EmptyLinesAroundArguments cop
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrylo committed Nov 4, 2018
1 parent 372cbbd commit d069ca3
Show file tree
Hide file tree
Showing 23 changed files with 0 additions and 57 deletions.
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,6 @@ Layout/EmptyLinesAroundArguments:
Exclude:
- 'spec/command_spec.rb'

# Offense count: 53
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Enabled: false

# Offense count: 47
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
Expand Down
1 change: 0 additions & 1 deletion lib/pry/indent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def indent(input)
prefix = indent_level

input.lines.each do |line|

if in_string?
tokens = tokenize("#{open_delimiters_line}\n#{line}")
tokens = tokens.drop_while{ |token, type| !(String === token && token.include?("\n")) }
Expand Down
2 changes: 0 additions & 2 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
expect(run).to equal true
expect(run2).to equal true
end

end

describe "processing options" do
Expand Down Expand Up @@ -83,6 +82,5 @@
expect(run).to eq true
expect(run2).to eq true
end

end
end
1 change: 0 additions & 1 deletion spec/code_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def process
it 'finds nothing when passing nil as the first argument' do
expect(Pry::CodeObject.lookup(nil, @p)).to eq nil
end

end

it 'should lookup instance methods defined on classes accessed via local variable' do
Expand Down
1 change: 0 additions & 1 deletion spec/command_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ def imported_helper_method; end
end

describe '.process_line' do

it 'should return Result.new(false) if there is no matching command' do
result = @set.process_line('1 + 42')
expect(result.command?).to eq false
Expand Down
10 changes: 0 additions & 10 deletions spec/command_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
require_relative 'helper'

describe "Pry::Command" do

before do
@set = Pry::CommandSet.new
@set.import Pry::Commands
end

describe 'call_safely' do

it 'should display a message if gems are missing' do
cmd = @set.create_command "ford-prefect", "From a planet near Beetlegeuse", requires_gem: %w(ghijkl) do
#
Expand Down Expand Up @@ -176,7 +174,6 @@ def options(opt)
end

describe 'classy api' do

it 'should call setup, then subcommands, then options, then process' do
cmd = @set.create_command 'rooster', "Has a tasty towel" do
def setup
Expand Down Expand Up @@ -237,7 +234,6 @@ def process

it 'should allow overriding options after definition' do
cmd = @set.create_command(/number-(one|two)/, "Lieutenants of the Golgafrinchan Captain", shellwords: false) do

command_options listing: 'number-one'
end

Expand Down Expand Up @@ -369,7 +365,6 @@ def process
Pry.config.collision_warning = true

cmd = @set.command '_frankie' do

end

_frankie = 'boyle'
Expand All @@ -386,7 +381,6 @@ def process
Pry.config.collision_warning = true

cmd = @set.command 'frankie' do

end

output = StringIO.new
Expand Down Expand Up @@ -469,7 +463,6 @@ def process
end

describe "block-related content removed from arguments" do

describe "arg_string" do
it 'should remove block-related content from arg_string (with one normal arg)' do
@set.block_command "walking-spanish", "down the hall", takes_block: true do |x, y|
Expand Down Expand Up @@ -643,7 +636,6 @@ def process
end

describe "a command made with a custom sub-class" do

before do
class MyTestCommand < Pry::ClassCommand
match(/my-*test/)
Expand Down Expand Up @@ -727,7 +719,6 @@ class CoolWinter < Pry::ClassCommand
end
end
end

end

describe "commands can save state" do
Expand All @@ -752,7 +743,6 @@ def process
state.my_state += 2
end
end

end.import Pry::Commands

@t = pry_tester(commands: @set)
Expand Down
2 changes: 0 additions & 2 deletions spec/commands/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ def foo

expect(@file).to eq @tempfile_path
expect(@line).to eq 14

end

it "should correctly find an instance method" do
Expand Down Expand Up @@ -718,7 +717,6 @@ def apply_monkey_patch(method, *eval_strs)
end

it "should change the alias, but not the original, without breaking super" do

$x = :bebe
pry_eval 'edit -p X#c'

Expand Down
1 change: 0 additions & 1 deletion spec/commands/play_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
end

describe "with an argument" do

# can't think of a f*cking way to test this!!
describe "implied file" do
# it 'should play from the file associated with the current binding' do
Expand Down
1 change: 0 additions & 1 deletion spec/commands/show_doc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def @o.sample_method
end

def @o.no_docs;end

end

after do
Expand Down
2 changes: 0 additions & 2 deletions spec/commands/show_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ def foo(*_bars)
end

it "finds super methods with explicit method argument" do

o = Foo.new
def o.foo(*_bars)
:wibble
Expand Down Expand Up @@ -455,7 +454,6 @@ def woof
end

it 'should lookup module name with respect to current context' do

temporary_constants(:AlphaClass, :BetaClass) do
class BetaClass
def alpha
Expand Down
1 change: 0 additions & 1 deletion spec/commands/watch_expression_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../helper'

describe "watch expression" do

# Custom eval that will:
# 1) Create an instance of pry that can use for multiple calls
# 2) Exercise the after_eval hook
Expand Down
1 change: 0 additions & 1 deletion spec/commands/whereami_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,4 @@ def blimey!
it "should work inside an object" do
expect(pry_eval(Object.new, 'whereami')).to match(/Inside #<Object/)
end

end
3 changes: 0 additions & 3 deletions spec/completion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ def self.name; :symboly_name; end
# Complete class variables.
b = Pry.binding_for(object.class)
completer_test(b).call('@@number', '@@number.class')

end

it 'should complete for stdlib symbols' do

o = Object.new
# Regexp
completer_test(o).call('/foo/.extend')
Expand Down Expand Up @@ -135,7 +133,6 @@ module Baz
end

it 'should complete for stdlib symbols' do

o = Object.new
# Regexp
completer_test(o).call('/foo/.extend')
Expand Down
4 changes: 0 additions & 4 deletions spec/control_d_handler_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require_relative 'helper'

describe Pry::DEFAULT_CONTROL_D_HANDLER do

describe "control-d press" do

before do
# Simulates a ^D press.
@control_d = "Pry::DEFAULT_CONTROL_D_HANDLER.call('', _pry_)"
Expand Down Expand Up @@ -56,7 +54,5 @@
end
end
end

end

end
1 change: 0 additions & 1 deletion spec/documentation_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@
expect(@helper.process_rdoc("--\n comment in a bubble\n++")).to match(/\+\+/)
end
end

end
1 change: 0 additions & 1 deletion spec/helpers/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def try_round_trip(expected)

it 'should not raise error' do
expect { Pry::Helpers.tablify(@out, @elem_len - 1) }.not_to raise_error

end

it 'should format output as one column' do
Expand Down
6 changes: 0 additions & 6 deletions spec/hooks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
expect(h2.get_hook(:test_hook3, :testing)).to eq nil
end
end

end
end

Expand Down Expand Up @@ -169,7 +168,6 @@

expect(hooks_dup.get_hook(:test_hook, :testing2)).not_to eq @hooks.get_hook(:test_hook, :testing2)
end

end

describe "getting hooks" do
Expand Down Expand Up @@ -323,7 +321,6 @@ def call() @test_var = true; end
end

describe "target" do

it 'should yield the target, as a binding ' do
b = nil
Pry.config.hooks.add_hook(:when_started, :test_hook) { |target, opt, _| b = target }
Expand Down Expand Up @@ -362,7 +359,6 @@ class << o; attr_accessor :value; end
expect(o.value).to eq true
Pry.config.hooks.delete_hook(:when_started, :test_hook)
end

end

describe "after_session hook" do
Expand Down Expand Up @@ -423,7 +419,6 @@ class << o; attr_accessor :value; end
expect(out.string).not_to match(/little_duck/)
end
end

end

describe "exceptions" do
Expand Down Expand Up @@ -469,5 +464,4 @@ class << o; attr_accessor :value; end
expect(x).to eq 2
end
end

end
1 change: 0 additions & 1 deletion spec/method/patcher_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative '../helper'

describe Pry::Method::Patcher do

before do
@x = Object.new
def @x.test; :before; end
Expand Down
1 change: 0 additions & 1 deletion spec/method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ class Bottom < Lower; extend O; end
def eigen_class(obj); class << obj; self; end; end

it "should look at a class and then its superclass" do

expect(Pry::Method.instance_resolution_order(LS::Next)).to eq [LS::Next] + Pry::Method.instance_resolution_order(LS::Top)
end

Expand Down
5 changes: 0 additions & 5 deletions spec/pry_defaults_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def readline(*args)
Pry.start(self, input: arity_multi_input, output: StringIO.new)
expect(arity_multi_input.prompt).to eq nil
end

end

it 'should set the output default, and the default should be overridable' do
Expand Down Expand Up @@ -288,7 +287,6 @@ def o.inspect; "a" * DEFAULT_OPTIONS; end
end

describe "given a regular object with an #inspect string longer than the maximum specified" do

describe "when the object is a regular one" do
it "returns a string of the #<class name:object idish> format" do
o = Object.new
Expand Down Expand Up @@ -333,11 +331,8 @@ def m.name; "a" * MAX_LENGTH; end
expect(Pry.view_clip(m, DEFAULT_OPTIONS)).to eq m.name
end
end

end

end

end

describe 'quiet' do
Expand Down
2 changes: 0 additions & 2 deletions spec/pry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
end

describe "Pry.binding_for" do

# regression test for burg's bug (see git history)
it "Should not error when object doesn't have a valid == method" do
o = Object.new
Expand Down Expand Up @@ -379,7 +378,6 @@ class Hello
end

describe "Object#pry" do

after do
Pry.reset_defaults
Pry.config.color = false
Expand Down
2 changes: 0 additions & 2 deletions spec/sticky_locals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
expect(o.instance_variable_get(:@value)).to eq :john
Pry.config.extra_sticky_locals = {}
end

end

describe "passing in as hash option when creating pry instance" do
Expand Down Expand Up @@ -171,5 +170,4 @@
expect(value1).not_to eq(value2)
end
end

end
1 change: 0 additions & 1 deletion spec/wrapped_module_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative 'helper'

describe Pry::WrappedModule do

describe "#initialize" do
it "should raise an exception when a non-module is passed" do
expect { Pry::WrappedModule.new(nil) }.to raise_error ArgumentError
Expand Down

0 comments on commit d069ca3

Please sign in to comment.