From 540bef55826f3d50c01e0f0ea91144093de8c55d Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 27 Feb 2023 12:29:09 -0500 Subject: [PATCH] Autofix Rubocop Layout/SpaceInsideParens https://docs.rubocop.org/rubocop/cops_layout.html#layoutspaceinsideparens --- .rubocop_todo.yml | 8 -------- test/tests.rb | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4859fc21..d140ea98 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -25,14 +25,6 @@ Layout/MultilineHashBraceLayout: - 'test/sample/file.rb' - 'test/tests.rb' -# Offense count: 12 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: space, compact, no_space -Layout/SpaceInsideParens: - Exclude: - - 'test/tests.rb' - # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowSafeAssignment. diff --git a/test/tests.rb b/test/tests.rb index be89e7fa..c9cbcaf0 100755 --- a/test/tests.rb +++ b/test/tests.rb @@ -1195,52 +1195,52 @@ def test_locate_qual_index Ox.default_options = $ox_object_options doc = Ox.parse(locate_xml) nodes = doc.locate('Family/Pete/?[0]') - assert_equal(['Kid1'], nodes.map { |e| e.value } ) + assert_equal(['Kid1'], nodes.map { |e| e.value }) nodes = doc.locate('Family/Pete/?[1]') - assert_equal(['Nicole'], nodes.map { |e| e.value } ) + assert_equal(['Nicole'], nodes.map { |e| e.value }) nodes = doc.locate('Family/Pete/?[2]') - assert_equal(['Kid2'], nodes.map { |e| e.value } ) + assert_equal(['Kid2'], nodes.map { |e| e.value }) end def test_locate_qual_less Ox.default_options = $ox_object_options doc = Ox.parse(locate_xml) nodes = doc.locate('Family/Pete/?[<1]') - assert_equal(['Kid1'], nodes.map { |e| e.value } ) + assert_equal(['Kid1'], nodes.map { |e| e.value }) end def test_locate_qual_great Ox.default_options = $ox_object_options doc = Ox.parse(locate_xml) nodes = doc.locate('Family/Pete/?[>1]') - assert_equal(['Kid2', 'Pamela'], nodes.map { |e| e.value } ) + assert_equal(['Kid2', 'Pamela'], nodes.map { |e| e.value }) end def test_locate_qual_last Ox.default_options = $ox_object_options doc = Ox.parse(locate_xml) nodes = doc.locate('Family/Pete/?[-1]') - assert_equal(['Pamela'], nodes.map { |e| e.value } ) + assert_equal(['Pamela'], nodes.map { |e| e.value }) end def test_locate_qual_last_attr Ox.default_options = $ox_object_options doc = Ox.parse(locate_xml) nodes = doc.locate('Family/Pete/?[-2]/@age') - assert_equal(['31'], nodes ) + assert_equal(['31'], nodes) end def test_locate_attr_match Ox.default_options = $ox_object_options doc = Ox.parse(locate_xml) nodes = doc.locate('Family/Pete/?[@age=32]') - assert_equal(['Kid1'], nodes.map { |e| e.value } ) + assert_equal(['Kid1'], nodes.map { |e| e.value }) nodes = doc.locate('Family/Pete/Kid1[@age=32]') - assert_equal(['Kid1'], nodes.map { |e| e.value } ) + assert_equal(['Kid1'], nodes.map { |e| e.value }) nodes = doc.locate('Family/Pete/Kid1[@age=31]') - assert_equal([], nodes.map { |e| e.value } ) + assert_equal([], nodes.map { |e| e.value }) end def test_locate_attr_presence @@ -1418,7 +1418,7 @@ def test_namespace_no_strip def test_namespace_strip_wild Ox.default_options = $ox_generic_options results = [] - doc = Ox.load('inside', :strip_namespace => true ) + doc = Ox.load('inside', :strip_namespace => true) assert_equal(%| inside @@ -1890,7 +1890,7 @@ def test_key_mod } ep = lambda { |k| k.downcase } ap = lambda { |k| 'a' + k } - doc = Ox.load(xml, mode: :generic, attr_key_mod: ap, element_key_mod: ep ) + doc = Ox.load(xml, mode: :generic, attr_key_mod: ap, element_key_mod: ep) xml2 = Ox.dump(doc) assert_equal(%{