Issue #17000 has been updated by marcandre (Marc-Andre Lafortune).


I understand (and also had to feel) the pain points. I can't imagine what this would have been with duplication warnings https://bugs.ruby-lang.org/issues/16289...

IIUC the proposal is basically to have "-W:no-deprecated" by default, right?

I fear this is only postponing the issue to having even more drastic breakage when 3.0 comes out. It has been 6 months that Ruby 2.7 is out with warnings by default.

The plan that these go from "opt-in warnings" to flat out errors in Ruby 3.0 in 6 months can only seem to me to be a mistake. I said it before (https://bugs.ruby-lang.org/issues/14183#change-73946 ), delegation is the major issue. The path should have involved a no warning by default release, and then a warning by default.

If we turn these deprecation warnings off, then we must have a 2.8 with warning turned on and a 3.0 in 1.5 years. Or we tick with deprecation warnings with 3.0 in 6 months.


I have the impression that the main annoyance is the difficulty in filtering between the end-user's code and dependencies. IMO a gem that could be loaded that would filter the warnings according to their originating call would be more useful and create less pain when 3.0 actually comes out.

In short: I'm am not in favor of the proposal as it stands.

----------------------------------------
Feature #17000: 2.7.2 turns off deprecation warnings by deafult
https://bugs.ruby-lang.org/issues/17000#change-86376

* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: nagachika (Tomoyuki Chikanaga)
----------------------------------------
Matz has decided to disable deprecation warnings for 3.0 keyword separation by default because many users feel them noisy and painful rather than useful.  See https://discuss.rubyonrails.org/t/new-2-7-3-0-keyword-argument-pain-point/74980/47 .

https://github.com/ruby/ruby/pull/3273 is a pull request for the change.  It is essentially one-line change in `error.c`, though it has many changes for tests that checks if the warning is appropriately emitted.

Note that this changeset disables *all* deprecation warnings by default.  The reason why I stop not only keyword-related deprecation warnings but all other ones is because, if we disable only keyword-related deprecation warnings, and if keep other deprecation on by default, it becomes ambiguous what `Warning[:deprecated]` should return.  We considered a new API like `Warning[:keyword_separation_deprecated] = true / false`, but we want to minimize the change because it goes to 2.7 branch.  Fortunately, there are not so many other warnings disabled together; a notable one is `Capturing the given block using Kernel#proc is deprecated; use `&block` instead`, but other warnings are minor, as far as I see.  It is somewhat unfortunate, but matz has already agreed with this direction.

Matz also said in the forum, "we will move on to the new keyword argument behavior in Ruby3.0 as planned".  This violates the traditional convention that "gradually" makes deprecation warnings noisy: deprecated behavior is (1) warned only when VERBOSE is enabled, (2) always warned, and (3) removed.  However, matz made this decision due to special circumstances of 3.0 keyword arguments; delaying the change will be also painful.

Note that, currently, the deprecation convention itself is not changed, so this patch is *not* going to master branch.  We can discuss the deprecation policy change in another ticket, if needed.  Anyway, let this ticket focus on ruby_2_7 branch change.  Please do not discuss the convention change in this ticket.

The final decision is up to 2.7 branch maintainer, @nagachika san, but I hope this change is accepted.

cc/ @jeremyevans0 @eregon @nobu @nagachika



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>