Project

General

Profile

Actions

Feature #13246

closed

[REQUEST] Allow to make rb_compile_warn a hard error

Added by kirs (Kir Shatrov) about 7 years ago. Updated about 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:79725]

Description

$ cat dup.rb
puts({ one: 1, one: 2})

$ ruby dup.rb
dup.rb:1: warning: key :one is duplicated and overwritten on line 1
{:one=>2}

I suppose it was initially made a warning for the backward compatibility reasons.

In case of our project, we'd like to raise on all warnings like this one and stop allowing developers to introduce the code with warnings.
This is a common error that developers make, especially when they use TDD and the test output is quite large and it's not easy to notice the warning.

I propose that we provide an API to catch rb_compile_warn events and allow to raise on them, or for instance report them to the exception notification library if it's running in production.

Actions

Also available in: Atom PDF

Like0
Like0