From c2752970da4a94feccd4a1c234e7dfeaf8804fef Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Mon, 8 Jun 2026 12:35:06 -0400 Subject: [PATCH 1/4] Make JRuby 10 a required CI target RubyCritic already ran end-to-end on JRuby, but its CI listed jruby-10.0 only as an experimental, continue-on-error target so it never had to pass. The test suite was the blocker: when flog/ruby_parser loaded before reek, Ruby 3.4's bundled_gems require shim clobbered Zeitwerk's implicit-namespace autoload on JRuby, so reek's dry-schema `Macros` namespace failed to load. Forcing reek's schema to load up front in test_helper (guarded by defined?(JRUBY_VERSION)) sidesteps the ordering issue. The application is unaffected because it loads reek before flog. - test_helper: eager reek schema load on JRuby - main.yml: promote jruby-10.0 from experimental include into the required matrix across all four jobs; ruby-head stays experimental - README: note JRuby 10 support in the Compatibility section Verified on JRuby 10: test (164), spec (14), rubocop (0 offenses), reek (0 warnings), mdl; MRI 4.0 test (164) shows no regression. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/main.yml | 12 ++++-------- README.md | 3 +++ test/test_helper.rb | 12 ++++++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c4672bda..6c2dc41c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,12 +32,11 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' 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 +62,11 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' 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 +92,11 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' 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 +122,11 @@ jobs: - '3.3' - '3.4' - '4.0' + - 'jruby-10.0' 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/README.md b/README.md index a7d6bb86..01b3d153 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,9 @@ RubyCritic is supporting Ruby versions: | 3.4 | latest | | 4.0 | latest | +RubyCritic also runs on JRuby 10 (which targets Ruby 3.4 compatibility) and is +tested against it in CI. + ## 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 From 64c52cbc8504b43b91a858354fefc3580d8c8317 Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Mon, 15 Jun 2026 08:45:43 -0400 Subject: [PATCH 2/4] Add CHANGELOG entry for JRuby 10 required CI target Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d9d05a3..f0076086 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [FEATURE] ... * [CHANGE] Replace all Cucumber features with Minitest/Spec specs (by [@faisal][]) +* [CHANGE] Make JRuby 10 a required CI target, and fix the test suite's gem load order on JRuby (by [@etagwerker][]) # v5.0.0 / 2026-01-26 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.12.0...v5.0.0) From b91770012157ca5310e1631a0177a33d0f51d08b Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Fri, 19 Jun 2026 14:27:54 -0400 Subject: [PATCH 3/4] Add jruby-10.1 as an experimental CI target JRuby 10.1 targets Ruby 4.0 compatibility (the project's current MRI top target) and is the latest stable JRuby line. Add it across all four jobs as continue-on-error, mirroring ruby-head, so it can be promoted to the required matrix once it's confirmed green. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c2dc41c..b200879c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,8 @@ jobs: include: - ruby-version: 'ruby-head' experimental: true + - ruby-version: 'jruby-10.1' + experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -67,6 +69,8 @@ jobs: include: - ruby-version: 'ruby-head' experimental: true + - ruby-version: 'jruby-10.1' + experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -97,6 +101,8 @@ jobs: include: - ruby-version: 'ruby-head' experimental: true + - ruby-version: 'jruby-10.1' + experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -127,6 +133,8 @@ jobs: include: - ruby-version: 'ruby-head' experimental: true + - ruby-version: 'jruby-10.1' + experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} From f2ee57d26a3f0368c10e0d2e31f5c1175144294d Mon Sep 17 00:00:00 2001 From: Ernesto Tagwerker Date: Sat, 20 Jun 2026 11:37:43 -0400 Subject: [PATCH 4/4] Promote jruby-10.1 to a required CI target jruby-10.1 has been green across all four jobs as an experimental target, so move it into the required matrix alongside jruby-10.0. Update the README compatibility section and CHANGELOG to note support for both JRuby 10.0 (Ruby 3.4 compat) and 10.1 (Ruby 4.0 compat). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/main.yml | 12 ++++-------- CHANGELOG.md | 2 +- README.md | 8 ++++++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b200879c..c05e960a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,12 +33,11 @@ jobs: - '3.4' - '4.0' - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.1' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -65,12 +64,11 @@ jobs: - '3.4' - '4.0' - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.1' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -97,12 +95,11 @@ jobs: - '3.4' - '4.0' - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.1' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} @@ -129,12 +126,11 @@ jobs: - '3.4' - '4.0' - 'jruby-10.0' + - 'jruby-10.1' experimental: [false] include: - ruby-version: 'ruby-head' experimental: true - - ruby-version: 'jruby-10.1' - experimental: true steps: - uses: actions/checkout@v6 - name: Set up Ruby ${{ matrix.ruby-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f1e54c..89385718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +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 a required CI target, and fix the test suite's gem load order on JRuby (by [@etagwerker][]) +* [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 01b3d153..3ff5b355 100644 --- a/README.md +++ b/README.md @@ -252,8 +252,12 @@ RubyCritic is supporting Ruby versions: | 3.4 | latest | | 4.0 | latest | -RubyCritic also runs on JRuby 10 (which targets Ruby 3.4 compatibility) and is -tested against it in CI. +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