diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4672bda..c05e960a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,12 +32,12 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.0' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -63,12 +63,12 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.0' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -94,12 +94,12 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.0' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -125,12 +125,12 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.0' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1316935f..89385718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * [CHANGE] Replace Aruba with direct API calls in specs (by [@faisal][]) * [CHANGE] Replace all Cucumber features with Minitest/Spec specs (by [@faisal][]) +* [CHANGE] Make JRuby 10.0 and 10.1 required CI targets, and fix the test suite's gem load order on JRuby (by [@etagwerker][]) * [BUGFIX] Add `lang="en"` to the report's `` element, give the menu-toggle anchor an `aria-label`, and make the per-rating summary IDs unique. Fixes 17 WCAG 2.1 AA structural errors on `overview.html`. (by [@MarcusAl][]) # v5.0.0 / 2026-01-26 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.12.0...v5.0.0) diff --git a/README.md b/README.md index a7d6bb86..3ff5b355 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,13 @@ RubyCritic is supporting Ruby versions: | 3.4 | latest | | 4.0 | latest | +RubyCritic also runs on JRuby and is tested against it in CI: + +| JRuby version | Targeted Ruby compatibility | +| --- | --- | +| 10.0 | 3.4 | +| 10.1 | 4.0 | + ## Improving RubyCritic RubyCritic doesn't have to remain a second choice to other code quality analysis services. Together, we can improve it and continue to build on the great code metric tools that are available in the Ruby ecosystem. diff --git a/test/test_helper.rb b/test/test_helper.rb index c92b23b5..99df6ae7 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -14,6 +14,18 @@ require 'ostruct' require 'diff/lcs' +# On JRuby, Ruby 3.4's bundled_gems require shim can clobber Zeitwerk's +# implicit-namespace autoloads if a bundled gem (e.g. racc, pulled in by +# ruby_parser/flog) re-wraps Kernel#require after Zeitwerk is set up. When that +# happens, reek's deferred load of dry-schema's `Macros` namespace fails with +# "cannot load such file -- .../dry/schema/macros". Forcing reek's schema to +# load up front, before any flog/ruby_parser require, sidesteps the ordering +# issue. The application itself is unaffected because it loads reek before flog. +if defined?(JRUBY_VERSION) + require 'reek' + Reek::Configuration::Schema +end + def context(...) describe(...) end