From f4a5fb838e308ddb6d1032f6f745e114794ffe55 Mon Sep 17 00:00:00 2001 From: Jakub Duchek Date: Thu, 20 Aug 2026 00:00:45 +0200 Subject: [PATCH] Refs #39354 - Update RuboCop dependencies Update RuboCop and its performance extension to releases that allow unicode-display_width 3.x in the generated CI lockfile. Assisted-By: Codex 5.6 Sol High --- .rubocop.yml | 2 +- .rubocop_todo.yml | 2 +- bundler.d/test.rb | 4 ++-- extra/migrations/20160413000000_migrate_puppet_settings.rb | 2 +- lib/launcher.rb | 2 +- modules/dhcp_common/server.rb | 2 +- modules/templates/templates_unattended_api.rb | 2 +- modules/tftp/tftp_api.rb | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2ca5e04f5..5d27a95a0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,4 @@ -require: +plugins: - rubocop-performance - rubocop-rake diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dacf86b16..49fbbd8b5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -193,7 +193,7 @@ Naming/MethodParameterName: # ForbiddenPrefixes: is_, has_, have_ # AllowedMethods: is_a? # MethodDefinitionMacros: define_method, define_singleton_method -Naming/PredicateName: +Naming/PredicatePrefix: Exclude: - 'spec/**/*' - 'modules/puppet_proxy_common/puppet_class.rb' diff --git a/bundler.d/test.rb b/bundler.d/test.rb index 122af11c5..211c87184 100644 --- a/bundler.d/test.rb +++ b/bundler.d/test.rb @@ -8,8 +8,8 @@ gem 'mocha', '~> 1.10', :require => false gem 'rack-test' gem 'rake' - gem 'rubocop', '~> 1.56.0' - gem 'rubocop-performance', '~> 1.5.2' + gem 'rubocop', '~> 1.88.0' + gem 'rubocop-performance', '~> 1.26.0' gem 'rubocop-rake' gem 'ruby-prof', '< 1.4' gem 'test-unit' diff --git a/extra/migrations/20160413000000_migrate_puppet_settings.rb b/extra/migrations/20160413000000_migrate_puppet_settings.rb index dd9c767bf..f2bcaa138 100644 --- a/extra/migrations/20160413000000_migrate_puppet_settings.rb +++ b/extra/migrations/20160413000000_migrate_puppet_settings.rb @@ -65,7 +65,7 @@ def migrate_puppet_configuration(to_migrate) if migrated.has_key?(:puppet_proxy_mcollective) puppet_user = migrated[:puppet_proxy_mcollective].delete(:puppet_user) - unless (migrated[:puppet_proxy_mcollective].has_key?(:user) || puppet_user.nil?) + unless migrated[:puppet_proxy_mcollective].has_key?(:user) || puppet_user.nil? migrated[:puppet_proxy_mcollective][:user] = puppet_user end end diff --git a/lib/launcher.rb b/lib/launcher.rb index 0967485bb..ba30a23b9 100644 --- a/lib/launcher.rb +++ b/lib/launcher.rb @@ -115,7 +115,7 @@ def resolve_tls_min_version def resolve_tls_ciphers configured = settings.tls_ciphers raise "Invalid tls_ciphers value '#{configured}': must be a String" if !configured.nil? && !configured.is_a?(String) - return nil if configured&.empty? + return nil if configured == '' return configured unless configured.nil? if File.exist?(CRYPTO_POLICIES_CONFIG) diff --git a/modules/dhcp_common/server.rb b/modules/dhcp_common/server.rb index a0b817665..d0ed5ee86 100644 --- a/modules/dhcp_common/server.rb +++ b/modules/dhcp_common/server.rb @@ -205,7 +205,7 @@ def vendor_options_supported? # Default: manage any subnet. If specified: manage only specified subnets. def managed_subnet?(subnet) - @managed_subnets.empty? ? true : @managed_subnets.include?(subnet) + @managed_subnets.empty? || @managed_subnets.include?(subnet) end end end diff --git a/modules/templates/templates_unattended_api.rb b/modules/templates/templates_unattended_api.rb index e2d295330..84332af7e 100644 --- a/modules/templates/templates_unattended_api.rb +++ b/modules/templates/templates_unattended_api.rb @@ -7,7 +7,7 @@ class Proxy::TemplatesUnattendedApi < Sinatra::Base # It will also modify the rendering of the foreman_url specified in the templates. get "/templateServer" do content_type :json - {"templateServer" => (Proxy::Templates::Plugin.settings.template_url || "")}.to_json + {"templateServer" => Proxy::Templates::Plugin.settings.template_url || ""}.to_json rescue => e log_halt 400, e end diff --git a/modules/tftp/tftp_api.rb b/modules/tftp/tftp_api.rb index 3c50cc3ed..69c618e59 100644 --- a/modules/tftp/tftp_api.rb +++ b/modules/tftp/tftp_api.rb @@ -21,7 +21,7 @@ def instantiate(variant, mac = nil) def create(variant, mac, os: nil, release: nil, arch: nil, bootfile_suffix: nil) tftp = instantiate variant, mac log_halt(400, "TFTP: Failed to setup host specific bootloader directory: ") { tftp.setup_bootloader(mac: mac, os: os, release: release, arch: arch, bootfile_suffix: bootfile_suffix) } - log_halt(400, "TFTP: Failed to create pxe config file: ") { tftp.set(mac, (params[:pxeconfig] || params[:syslinux_config])) } + log_halt(400, "TFTP: Failed to create pxe config file: ") { tftp.set(mac, params[:pxeconfig] || params[:syslinux_config]) } end def delete(variant, mac) @@ -70,7 +70,7 @@ def create_default(variant) # Get the value for next_server get "/serverName" do - {"serverName" => (Proxy::TFTP::Plugin.settings.tftp_servername || "")}.to_json + {"serverName" => Proxy::TFTP::Plugin.settings.tftp_servername || ""}.to_json end end end