diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9a2e4dbe91..840f54f28f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,17 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 50` -# on 2023-03-10 05:47:20 UTC using RuboCop version 1.46.0. +# on 2023-06-26 20:38:41 UTC using RuboCop version 1.53.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/MixedCaseRange: + Exclude: + - 'test/test_compaction.rb' + # Offense count: 22 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. @@ -35,7 +41,7 @@ Style/MissingRespondToMissing: Exclude: - 'lib/nokogiri/xml/builder.rb' -# Offense count: 74 +# Offense count: 70 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https diff --git a/Gemfile b/Gemfile index 552e96a31d..38604eaa7d 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ group :development do # rubocop if Gem::Requirement.new("~> 3.0").satisfied_by?(Gem::Version.new(RUBY_VERSION)) - gem "rubocop", "1.52.1" + gem "rubocop", "1.53.1" gem "rubocop-minitest", "0.31.0" gem "rubocop-packaging", "0.5.2" gem "rubocop-performance", "1.18.0" diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index a0bcba35bc..33e9963ef4 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -443,7 +443,7 @@ def recipe.port_path # We use 'host' to set compiler prefix for cross-compiling. Prefer host_alias over host. And # prefer i686 (what external dev tools use) to i386 (what ruby's configure.ac emits). recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] - recipe.host = recipe.host.gsub(/i386/, "i686") + recipe.host = recipe.host.gsub("i386", "i686") recipe.target = File.join(PACKAGE_ROOT_DIR, "ports") if cacheable_p recipe.configure_options << "--libdir=#{File.join(recipe.path, "lib")}" diff --git a/lib/nokogiri/xml/searchable.rb b/lib/nokogiri/xml/searchable.rb index 52536291f8..ee438c0412 100644 --- a/lib/nokogiri/xml/searchable.rb +++ b/lib/nokogiri/xml/searchable.rb @@ -229,7 +229,7 @@ def xpath_internal(node, paths, handler, ns, binds) def xpath_impl(node, path, handler, ns, binds) ctx = XPathContext.new(node) ctx.register_namespaces(ns) - path = path.gsub(/xmlns:/, " :") unless Nokogiri.uses_libxml? + path = path.gsub("xmlns:", " :") unless Nokogiri.uses_libxml? binds&.each do |key, value| ctx.register_variable(key.to_s, value) diff --git a/lib/nokogiri/xslt.rb b/lib/nokogiri/xslt.rb index 7fe33f70ed..73072d9d0f 100644 --- a/lib/nokogiri/xslt.rb +++ b/lib/nokogiri/xslt.rb @@ -101,7 +101,7 @@ def quote_params(params) params.flatten.each_slice(2).with_object([]) do |kv, quoted_params| key, value = kv.map(&:to_s) value = if value.include?("'") - "concat('#{value.gsub(/'/, %q{', "'", '})}')" + "concat('#{value.gsub("'", %q{', "'", '})}')" else "'#{value}'" end diff --git a/test/html5/test_serialize.rb b/test/html5/test_serialize.rb index 3961e052c4..a250ec3701 100644 --- a/test/html5/test_serialize.rb +++ b/test/html5/test_serialize.rb @@ -198,7 +198,7 @@ def test_initial_linefeed_pre_inner # https://github.com/web-platform-tests/wpt/blob/master/html/syntax/serializing-html-fragments/serializing.html def serializing_test_data @serializing_test_data ||= begin - html = <<~EOF.gsub(/ /, "") + html = <<~EOF.gsub(" ", "")