
Issue #21636 has been updated by alexanderadam (Alexander Adam). Thank you so much for your feedback! 🙏 You were absolutely right: I simplified the PR and made it explicit now to run only on the tested types, making it a far more predictable outcome. Thus I'm not so keen about my proposal right now any more. 😉 ---------------------------------------- Feature #21636: Proposal to Introduce a Dedicated Warning Category for Regular Expressions https://bugs.ruby-lang.org/issues/21636#change-114848 * Author: alexanderadam (Alexander Adam) * Status: Open ---------------------------------------- Hi folks, while working on adding regex support for the marcel gem (see PR: https://github.com/rails/marcel/pull/132), I encountered regex warnings triggered by some of Tika’s regular expressions. Typically, these warnings are valid but in this case I'd like to silence them for one single call. Currently, to suppress these warnings, I have overridden `$VERBOSE`, which effectively silences all warnings but also hides potentially important ones. This feels like a blunt instrument that might mask unrelated issues. Fortunately, Ruby already supports dedicated warning categories, as detailed in these discussions and pull requests: * https://bugs.ruby-lang.org/issues/17122 * https://bugs.ruby-lang.org/issues/11588 * https://github.com/ruby/ruby/pull/3505 Given this existing framework, I would like to propose introducing a dedicated warning category for regular expressions. This would allow libraries and applications to suppress only regex-related warnings selectively, for example, with `Warning[:regexp] = false`. Such a feature would provide more granular control over warnings without compromising the visibility of other important warnings. -- https://bugs.ruby-lang.org/