diff --git a/.rubocop.yml b/.rubocop.yml index def815012c..29c74a704e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,12 +5,14 @@ inherit_mode: require: - standard + - rubocop-packaging + - rubocop-rake + +plugins: - standard-custom - standard-performance - rubocop-performance - rubocop-minitest - - rubocop-packaging - - rubocop-rake inherit_gem: standard: config/base.yml diff --git a/Gemfile b/Gemfile index 0d97621670..9d8698be00 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,7 @@ group :development do gem "simplecov", "= 0.21.2" # rubocop - gem "standard", "1.45.0" + gem "standard", "1.47.0" gem "rubocop-minitest", "0.37.0" gem "rubocop-packaging", "0.5.2" gem "rubocop-rake", "0.6.0" diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 5efeb33dc2..2960367e6b 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -461,7 +461,7 @@ def recipe.port_path yield recipe env = Hash.new do |hash, key| - hash[key] = (ENV[key]).to_s + hash[key] = ENV[key].to_s end recipe.configure_options.flatten! diff --git a/lib/nokogiri/xml/document.rb b/lib/nokogiri/xml/document.rb index 6c9d4949a1..445b815672 100644 --- a/lib/nokogiri/xml/document.rb +++ b/lib/nokogiri/xml/document.rb @@ -502,10 +502,10 @@ def deconstruct_keys(keys) { root: root } end - private - IMPLIED_XPATH_CONTEXTS = ["//"].freeze # :nodoc: + private + def inspect_attributes [:name, :children] end diff --git a/lib/nokogiri/xml/node.rb b/lib/nokogiri/xml/node.rb index 270fea2272..82f784a9af 100644 --- a/lib/nokogiri/xml/node.rb +++ b/lib/nokogiri/xml/node.rb @@ -1605,6 +1605,8 @@ def coerce(data) EOERR end + IMPLIED_XPATH_CONTEXTS = [".//"].freeze # :nodoc: + private def keywordify(keywords) @@ -1655,8 +1657,6 @@ def inspect_attributes [:name, :namespace, :attribute_nodes, :children] end - IMPLIED_XPATH_CONTEXTS = [".//"].freeze - def add_child_node_and_reparent_attrs(node) add_child_node(node) node.attribute_nodes.find_all { |a| a.name.include?(":") }.each do |attr_node|