Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- '3.2'
- '3.3'
- '3.4'
- '4.0'
experimental: [false]
include:
- ruby-version: 'ruby-head'
Expand Down Expand Up @@ -61,6 +62,7 @@ jobs:
- '3.2'
- '3.3'
- '3.4'
- '4.0'
experimental: [false]
include:
- ruby-version: 'ruby-head'
Expand Down Expand Up @@ -91,6 +93,7 @@ jobs:
- '3.2'
- '3.3'
- '3.4'
- '4.0'
experimental: [false]
include:
- ruby-version: 'ruby-head'
Expand Down Expand Up @@ -121,6 +124,7 @@ jobs:
- '3.2'
- '3.3'
- '3.4'
- '4.0'
experimental: [false]
include:
- ruby-version: 'ruby-head'
Expand Down Expand Up @@ -149,7 +153,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
ruby-version: '4.0'
bundler-cache: true
cache-version: 1
continue-on-error: ${{ matrix.experimental }}
Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.11.0...main)
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.12.0...main)

* [CHANGE] ...
* [BUGFIX] ...
* [CHORE] ...
* [FEATURE] ...

* [CHORE] Sorted cops in .rubocop.yml to make it easier for maintainers to add or modify cop settings, and unified duplicate Metrics/MethodLength settings. (by [@faisal][])
* [CHORE] Updated README with last supported Ruby versions for the older as well as the latest releases of Rubycritic/Ruby (by [@faisal][])
* [CHORE] Bump byebug dependency (by [@faisal][])
* [CHORE] Bump mdl and mocha dependencies (by [@faisal][])
* [CHORE] Bump minitest dependency, and add minitest-mock dependency (by [@faisal][])
* [CHORE] Bump fakefs dependency, and drop irb dependency (by [@faisal][])
* [CHORE] In RubyCritic::Generator::Html::Line, require cgi/escape rather than cgi, as the latter is removed from Ruby 4.0 (by [@faisal][])
* [CHORE] Run Markdown linting in CI using Ruby 4.0 (by [@faisal][])
* [CHANGE] Sorted cops in .rubocop.yml to make it easier for maintainers to add or modify cop settings, and unified duplicate Metrics/MethodLength settings. (by [@faisal][])
* [CHANGE] Drop support for Ruby 3.1.x and JRuby 9.4 (by [@faisal][])
* [CHANGE] Add CI support for JRuby 10.0 (by [@faisal][])
* [CHORE] Start testing library with Ruby 4.0 (by [@etagwerker][])

# v4.12.0 / 2026-01-01 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.11.0...v4.12.0)

* [CHANGE] Bump cucumber dependency (by [@faisal][])
* [BUGFIX] Fixed regression in compatibility with Flog 4.9.0 (by [@faisal][])
* [CHANGE] Bump mocha dependency (by [@faisal][])
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ RubyCritic is supporting Ruby versions:
| 2.6 | [v4.7.0](https://github.com/whitesmith/rubycritic/tree/v4.7.0) |
| 2.7 | [v4.9.1](https://github.com/whitesmith/rubycritic/tree/v4.9.1) |
| 3.0 | [v4.9.2](https://github.com/whitesmith/rubycritic/tree/v4.9.1) |
| 3.1 | [v4.11.0](https://github.com/whitesmith/rubycritic/tree/v4.11.0) |
| 3.1 | [v4.12.0](https://github.com/whitesmith/rubycritic/tree/v4.12.0) |
| 3.2 | latest |
| 3.3 | latest |
| 3.4 | latest |
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/rubycritic_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

Then(/^it reports the current version$/) do
expect(last_command_started).to have_output("RubyCritic #{RubyCritic::VERSION}\n")
expect(last_command_started).to have_output(an_output_string_including("RubyCritic #{RubyCritic::VERSION}"))
end

Then(/^it reports the error ['"](.*)['"]$/) do |string|
Expand Down
5 changes: 4 additions & 1 deletion lib/rubycritic/analysers/smells/reek.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class ReekSmells
include Colorize

def initialize(analysed_modules)
@analysed_modules = analysed_modules.reject { Reek.configuration.path_excluded?(_1.pathname) }
@analysed_modules = analysed_modules.reject do |mod|
path_string = mod.pathname.to_s
Reek.configuration.path_excluded?(Pathname.new(path_string))
end
end

def run
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/generators/html/line.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require 'cgi'
require 'cgi/escape'
require 'rubycritic/generators/html/base'

module RubyCritic
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RubyCritic
VERSION = '4.12.0'
VERSION = '5.0.0'
end
7 changes: 3 additions & 4 deletions rubycritic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'flay', '~> 2.13'
spec.add_dependency 'flog', '~> 4.7'
spec.add_dependency 'launchy', '>= 2.5.2'
spec.add_dependency 'ostruct'
spec.add_dependency 'parser', '>= 3.3.0.5'
spec.add_dependency 'prism', '>= 1.6.0'
spec.add_dependency 'rainbow', '~> 3.1.1'
Expand All @@ -50,18 +51,16 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'jar-dependencies', '~> 0.5.5'
spec.add_development_dependency 'pry-debugger-jruby'
else
spec.add_development_dependency 'byebug', '~> 12.0', '>= 10.0'
spec.add_development_dependency 'byebug', '~> 13.0', '>= 10.0'
end
spec.add_development_dependency 'cucumber', '~> 10.2.0', '>= 10.1.0'
spec.add_development_dependency 'diff-lcs', '~> 1.3'
spec.add_development_dependency 'fakefs', '~> 3.0.0'
spec.add_development_dependency 'irb'
spec.add_development_dependency 'fakefs', '~> 3.2.0'
spec.add_development_dependency 'mdl', '~> 0.15.0', '>= 0.12.0'
spec.add_development_dependency 'minitest', '~> 6.0.0'
spec.add_development_dependency 'minitest-around', '~> 0.6.0'
spec.add_development_dependency 'minitest-mock'
spec.add_development_dependency 'mocha', '~> 3.0.0'
spec.add_development_dependency 'ostruct'
spec.add_development_dependency 'rake', '~> 13.3.0', '>= 11.0.0'
spec.add_development_dependency 'rdoc'
spec.add_development_dependency 'rexml', '>= 3.2.0'
Expand Down
13 changes: 13 additions & 0 deletions test/fakefs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ def home(user = Etc.getlogin)
end
end
FakeFS::Dir.singleton_class.prepend(FakeFSPatch)

# Patch FakeFS::Pathname to include the path method for Ruby 4.0.0 compatibility
# This is needed because Reek's configuration internally calls Pathname#== which
# requires the path method to be present
module FakeFS
class Pathname
undef :path

def path
to_s
end
end
end
Loading