Skip to content

Commit 27f305f

Browse files
authored
Get to green, then update dependencies (#526)
* Apply or suppress changes suggested by more modern rubocop. * Fix feature execution on Ruby 3.5.0dev cucumber-core fails on Ruby 3.5.0dev due to a change in the expected method signature for Cucumber::Core::Test::Location#from_source_location. Work around this by aliasing out the old method and then using a new proxy method to catch the method and send the old style message to the old method. * Bump aruba, byebug, cucumber, fakefs, rake, reek dependencies Also corrected multiple Minitest/EmptyLineBeforeAssertionMethods issues flagged by rubocop-minitst.
1 parent 65e5be4 commit 27f305f

33 files changed

+106
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.9.2...main)
22

3+
* [CHANGE] Bump aruba, byebug, cucumber, fakefs, rake, reek dependencies (by [@faisal][])
4+
* [BUGFIX] Work around issue preventing feature execution on Ruby 3.5.0dev (by [@faisal][])
5+
* [CHANGE] Add changes or suppress warnings for issues found by newer rubocop (by [@faisal][])
36
* [CHANGE] Update CI checkout action to v4 (by [@faisal][])
47

58
# v4.9.2 / 2025-04-08 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.9.1...v4.9.2)

features/support/env.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# frozen_string_literal: true
22

3+
if RUBY_VERSION == '3.5.0' && RUBY_PATCHLEVEL == -1
4+
module Cucumber
5+
module Core
6+
module Test
7+
module Location
8+
singleton_class.send(:alias_method, :original_from_source_location, :from_source_location)
9+
def self.from_source_location(file, start_line, _start_column = nil, _end_line = nil, _end_column = nil)
10+
original_from_source_location(file, start_line)
11+
end
12+
end
13+
end
14+
end
15+
end
16+
end
17+
318
require_relative '../../lib/rubycritic'
419
require_relative '../../lib/rubycritic/cli/application'
520
require_relative '../../lib/rubycritic/commands/status_reporter'
@@ -11,6 +26,7 @@
1126
#
1227
class RubyCriticWorld
1328
extend Minitest::Assertions
29+
1430
attr_accessor :assertions
1531

1632
def initialize

lib/rubycritic/analysers/attributes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module RubyCritic
88
module Analyser
99
class Attributes
1010
include Colorize
11+
1112
def initialize(analysed_modules)
1213
@analysed_modules = analysed_modules
1314
end

lib/rubycritic/analysers/churn.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module RubyCritic
66
module Analyser
77
class Churn
88
include Colorize
9+
910
attr_writer :source_control_system
1011

1112
def initialize(analysed_modules)

lib/rubycritic/analysers/complexity.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module RubyCritic
77
module Analyser
88
class Complexity
99
include Colorize
10+
1011
def initialize(analysed_modules)
1112
@flog = Flog.new
1213
@analysed_modules = analysed_modules

lib/rubycritic/analysers/smells/flay.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module RubyCritic
88
module Analyser
99
class FlaySmells
1010
include Colorize
11+
1112
def initialize(analysed_modules)
1213
@analysed_modules = paths_to_analysed_modules(analysed_modules)
1314
@flay = Flay.new(@analysed_modules.keys)

lib/rubycritic/analysers/smells/flog.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module RubyCritic
88
module Analyser
99
class FlogSmells
1010
include Colorize
11+
1112
HIGH_COMPLEXITY_SCORE_THRESHOLD = 25
1213
VERY_HIGH_COMPLEXITY_SCORE_THRESHOLD = 60
1314

lib/rubycritic/analysers/smells/reek.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module RubyCritic
88
module Analyser
99
class ReekSmells
1010
include Colorize
11+
1112
def initialize(analysed_modules)
1213
@analysed_modules = analysed_modules
1314
end

lib/rubycritic/commands/status_reporter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def update_status
2626
end
2727

2828
def current_status
29-
satisfy_minimum_score_rule ? SUCCESS : SCORE_BELOW_MINIMUM
29+
satisfy_minimum_score_rule? ? SUCCESS : SCORE_BELOW_MINIMUM
3030
end
3131

32-
def satisfy_minimum_score_rule
32+
def satisfy_minimum_score_rule?
3333
score >= @options[:minimum_score].to_f
3434
end
3535

lib/rubycritic/rake_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def run_task
7171

7272
def print_starting_up_output
7373
puts "\n\n!!! Running `#{name}` rake command\n"
74-
puts "!!! Inspecting #{paths} #{options.empty? ? '' : "with options #{options}"}\n\n"
74+
puts "!!! Inspecting #{paths} #{"with options #{options}" unless options.empty?}\n\n"
7575
end
7676

7777
def options_as_arguments

0 commit comments

Comments
 (0)