From 25569c572aacf5c16ce9a26c65ec50b211086b22 Mon Sep 17 00:00:00 2001 From: ydah Date: Fri, 22 Aug 2025 20:45:31 +0900 Subject: [PATCH 1/3] Update RuboCop dependencies and configuration --- prawn-dev.gemspec | 6 +++--- rubocop.yml | 16 +++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/prawn-dev.gemspec b/prawn-dev.gemspec index 5918151..b592463 100644 --- a/prawn-dev.gemspec +++ b/prawn-dev.gemspec @@ -32,9 +32,9 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency('rake', '~> 13.0') spec.add_runtime_dependency('rouge', '~> 4.2') spec.add_runtime_dependency('rspec', '~> 3.12') - spec.add_runtime_dependency('rubocop', '~> 1.61.0') - spec.add_runtime_dependency('rubocop-performance', '~> 1.20.2') - spec.add_runtime_dependency('rubocop-rspec', '~> 2.26.1') + spec.add_runtime_dependency('rubocop', '~> 1.80.0') + spec.add_runtime_dependency('rubocop-performance', '~> 1.25.0') + spec.add_runtime_dependency('rubocop-rspec', '~> 3.6.0') spec.add_runtime_dependency('simplecov', '~> 0.22.0') spec.add_runtime_dependency('webrick', '~> 1.8.1') spec.add_runtime_dependency('yard', '~> 0.9.35') diff --git a/rubocop.yml b/rubocop.yml index 8d8217d..5918930 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,6 +1,8 @@ -require: +plugins: - rubocop-performance - rubocop-rspec + +require: - rubocop/cop/prawn_cops AllCops: @@ -584,18 +586,6 @@ Performance/StringInclude: Performance/Sum: Enabled: true -RSpec/Capybara: - Enabled: false - -Capybara: - Enabled: false - -FactoryBot: - Enabled: false - -RSpec/Rails: - Enabled: false - RSpec/BeEmpty: Enabled: true From 501f4f8b3de19ef3b1aab12f84d4539797977797 Mon Sep 17 00:00:00 2001 From: ydah Date: Fri, 22 Aug 2025 20:46:47 +0900 Subject: [PATCH 2/3] Fix an error when running rubocop ``` An error occurred while Style/TrailingCommaInArguments cop was inspecting /Users/ydah/prawn-dev/prawn-dev.gemspec:27:15. /Users/ydah/prawn-dev/lib/rubocop/cop/prawn/style/trailing_comma_fix.rb:10:in 'RuboCop::Cop::Prawn::Style::TrailingCommaFix#should_have_comma?': undefined method 'line' for nil (NoMethodError) node.loc.begin.line != node.loc.end.line # parens are on different lines ``` --- lib/rubocop/cop/prawn/style/trailing_comma_fix.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rubocop/cop/prawn/style/trailing_comma_fix.rb b/lib/rubocop/cop/prawn/style/trailing_comma_fix.rb index c5fff9f..ab0884f 100644 --- a/lib/rubocop/cop/prawn/style/trailing_comma_fix.rb +++ b/lib/rubocop/cop/prawn/style/trailing_comma_fix.rb @@ -7,7 +7,8 @@ module Style module TrailingCommaFix def should_have_comma?(style, node) if style == :prawn_comma - node.loc.begin.line != node.loc.end.line # parens are on different lines + node.loc.begin && node.loc.end && + (node.loc.begin.line != node.loc.end.line) # parens are on different lines else super end From 1b2897e440c20564b87ef294924f1c3009ff8c55 Mon Sep 17 00:00:00 2001 From: ydah Date: Fri, 22 Aug 2025 20:47:27 +0900 Subject: [PATCH 3/3] Fix an offense for Lint/DuplicateRequire ``` Offenses: lib/prawn/dev/tasks.rb:54:1: W: [Corrected] Lint/DuplicateRequire: Duplicate require detected. require 'fileutils' ^^^^^^^^^^^^^^^^^^^ ``` --- lib/prawn/dev/tasks.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/prawn/dev/tasks.rb b/lib/prawn/dev/tasks.rb index e0f9509..bd2418e 100644 --- a/lib/prawn/dev/tasks.rb +++ b/lib/prawn/dev/tasks.rb @@ -51,7 +51,6 @@ end task docs: :yard -require 'fileutils' def stash_yardopts if File.exist?('.yardopts') begin