Repository navigation
Conversation
Signed-off-by: AC <ac@fabtek.cn>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On JRuby, assigning
DidYouMean.formatter = CustomFormattercurrently has no effect: the setter only writes inside the Ractor branch, and the getter always returnsFormatteroutside it. This also prevents callers from disabling suggestions with their own formatter.Store and read the configured formatter on the module when Ractor is unavailable. The setting is shared between threads on those runtimes; Ractor-capable Rubies retain their existing per-Ractor storage. Assigning
nilrestores the default.Fixes #191. Tests cover custom error-message rendering, resetting the formatter, and sharing the setting between threads without Ractor. The custom-formatter and cross-thread regressions both fail before the change on JRuby 9.4.8.0 / OpenJDK 21 / Linux arm64, and pass afterward.
Validation:
RUBYOPT=--disable-did_you_mean bundle exec rake— 82 tests, 249 assertions, no failures/errors.libandtestpaths,--disable-did_you_mean, and test-unit 3.7.8 — 76 tests, 224 assertions, no failures/errors, 2 pre-existing explicitly omitted JRuby cases. Ractor tests are not defined on JRuby.git diff --checkpassed. Other versions and Windows were not run locally.AI assistance: OpenAI Codex investigated, implemented, and ran these checks.