From: merch-redmine@... Date: 2020-07-02T01:15:11+00:00 Subject: [ruby-core:99024] [Ruby master Feature#17000] 2.7.2 turns off deprecation warnings by deafult Issue #17000 has been updated by jeremyevans0 (Jeremy Evans). nagachika (Tomoyuki Chikanaga) wrote in #note-6: > jeremyevans0 (Jeremy Evans) wrote in #note-4: > > An alternative approach to adding `Warning[:keyword_deprecated]` that would be easier to implement in 2.7 and would not require changes to master would be only printing keyword argument warnings in verbose mode. This should be a one-line change here: https://github.com/ruby/ruby/blob/ruby_2_7/vm_args.c#L600 > > I understand your proposal is enabling all warnings in "deprecated" category (keywords and others) only if $VERBOSE=true and `Warning[:deprecated]=true`, is that right? No, my proposal only affects keyword arguments. `rb_warn_check` is only called by the three functions that issue deprecation warnings for keyword arguments (all three callers are directly below in `vm_args.c`). > I rather like to suppress only keyword arguments warning without $VERBOSE=true and don't suppress other deprecated category warning. I believe modifying the line I referenced should be sufficient to implement the proposal in your table. Well, it may spill into a second line as that line already has 78 characters, but that should be the only location needed. I can prepare a patch if you would like. ---------------------------------------- Feature #17000: 2.7.2 turns off deprecation warnings by deafult https://bugs.ruby-lang.org/issues/17000#change-86399 * 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: