From daa373568833f7b117e1dba8816da802c787b343 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Thu, 29 Jan 2026 14:21:40 -0700 Subject: [PATCH] Bump rubocop version and fix offenses I am removing the version from Gemfile since we don't have any reason to pin it to a specific version. We keep the dependency up to date. Offenses fixed: - lib/faker/default/string.rb:27:25: C: [Correctable] Style/ModuleMemberExistenceCheck: Use include?(Enumerable) instead. - lib/helpers/unique_generator.rb:33:5: C: [Correctable] Style/EmptyClassDefinition: Prefer a two-line class definition over Class.new for classes with no body. --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- lib/faker/default/string.rb | 2 +- lib/helpers/unique_generator.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 735747a2ea..6b3e5dc69c 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'minitest', '5.27.0' gem 'pry', '0.16.0' gem 'rake', '13.3.1' gem 'rdoc' -gem 'rubocop', '1.82.1' +gem 'rubocop' gem 'rubocop-minitest', '0.38.2' gem 'rubocop-rake', '0.7.1' gem 'simplecov', '0.22.0' diff --git a/Gemfile.lock b/Gemfile.lock index 02b3913f35..9be09d9215 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,14 +30,14 @@ GEM method_source (1.1.0) minitest (5.27.0) parallel (1.27.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) pp (0.6.3) prettyprint prettyprint (0.2.0) - prism (1.7.0) + prism (1.9.0) pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) @@ -55,7 +55,7 @@ GEM regexp_parser (2.11.3) reline (0.6.3) io-console (~> 0.5) - rubocop (1.82.1) + rubocop (1.84.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -63,7 +63,7 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.48.0, < 2.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.49.0) @@ -107,7 +107,7 @@ DEPENDENCIES pry (= 0.16.0) rake (= 13.3.1) rdoc - rubocop (= 1.82.1) + rubocop rubocop-minitest (= 0.38.2) rubocop-rake (= 0.7.1) simplecov (= 0.22.0) diff --git a/lib/faker/default/string.rb b/lib/faker/default/string.rb index 25c7b837f6..d437b4d46c 100644 --- a/lib/faker/default/string.rb +++ b/lib/faker/default/string.rb @@ -24,7 +24,7 @@ def random(length: 32) private def select_a(length) - if length.class.included_modules.include? Enumerable + if length.class.include?(Enumerable) select_a sample(length.to_enum.to_a) else length # recursive base case diff --git a/lib/helpers/unique_generator.rb b/lib/helpers/unique_generator.rb index b6115671ff..634589ea94 100644 --- a/lib/helpers/unique_generator.rb +++ b/lib/helpers/unique_generator.rb @@ -30,7 +30,7 @@ def respond_to_missing?(method_name, include_private = false) method_name.to_s.start_with?('faker_') || super end - RetryLimitExceeded = Class.new(StandardError) + class RetryLimitExceeded < StandardError; end def previous_results Thread.current[:faker_unique_generator_previous_results] ||= {}