Project

General

Profile

Actions

Feature #21636

open

Proposal to Introduce a Dedicated Warning Category for Regular Expressions

Added by alexanderadam (Alexander Adam) about 19 hours ago. Updated about 1 hour ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:<unknown>]

Description

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:

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0