From 7b5401b54db0cbd1d0115dba359e653fddb0cb5c Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sun, 24 Feb 2019 20:13:17 +0200 Subject: [PATCH] rubocop: fix offences of the Layout/AlignArray cop --- .rubocop_todo.yml | 7 ------- lib/pry/commands/ls/ls_entity.rb | 6 ++++-- spec/pry_spec.rb | 5 +++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 41d18be5..def1c5b5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -13,13 +13,6 @@ Gemspec/RequiredRubyVersion: Exclude: - 'pry.gemspec' -# Offense count: 2 -# Cop supports --auto-correct. -Layout/AlignArray: - Exclude: - - 'lib/pry/commands/ls/ls_entity.rb' - - 'spec/pry_spec.rb' - # Offense count: 34 # Cop supports --auto-correct. # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. diff --git a/lib/pry/commands/ls/ls_entity.rb b/lib/pry/commands/ls/ls_entity.rb index 916f710d..918e2d54 100644 --- a/lib/pry/commands/ls/ls_entity.rb +++ b/lib/pry/commands/ls/ls_entity.rb @@ -61,8 +61,10 @@ class Pry end def entities - [globals, constants, methods, self_methods, instance_vars, local_names, - local_vars] + [ + globals, constants, methods, self_methods, instance_vars, local_names, + local_vars + ] end end end diff --git a/spec/pry_spec.rb b/spec/pry_spec.rb index d109d426..25986623 100644 --- a/spec/pry_spec.rb +++ b/spec/pry_spec.rb @@ -367,8 +367,9 @@ describe Pry do # JRuby behaves different than CRuby here (seems it always has to some extent, see 'unless' below). # It didn't seem trivial to work around. Skip for now. skip "JRuby incompatibility" if Pry::Helpers::Platform.jruby? - [:test, 0, true, false, nil, - (0.0 unless Pry::Helpers::Platform.jruby?)].each do |val| + [ + :test, 0, true, false, nil, (0.0 unless Pry::Helpers::Platform.jruby?) + ].each do |val| pry_eval(val, "def hello; end"); expect(val.class.instance_methods(false).map(&:to_sym).include?(:hello)).to eq true end