From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 6BE1E1F9FD for ; Tue, 16 Feb 2021 12:31:29 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 111FB120ACC; Tue, 16 Feb 2021 21:30:33 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id D5427120ACA for ; Tue, 16 Feb 2021 21:30:30 +0900 (JST) Received: by filterdrecv-p3las1-c477c4585-j7t5v with SMTP id filterdrecv-p3las1-c477c4585-j7t5v-19-602BBB19-AD 2021-02-16 12:31:21.952465334 +0000 UTC m=+567803.965580101 Received: from herokuapp.com (unknown) by ismtpd0099p1iad2.sendgrid.net (SG) with ESMTP id oH9ej71YTJigiT5_7ZaTgg for ; Tue, 16 Feb 2021 12:31:21.844 +0000 (UTC) Date: Tue, 16 Feb 2021 12:31:21 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78465 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Misc X-Redmine-Issue-Id: 17591 X-Redmine-Issue-Author: Eregon X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr2T03GdS5Cw+=2F8wFTkESz?= =?us-ascii?Q?=2F7kcwbDkjNYt5bhxQJruMvaOc+QoXM2Jk=2FlN8wL?= =?us-ascii?Q?jhmHopsH7aljXqLoZDHnVYckxMHr2wPI9MpRIUa?= =?us-ascii?Q?byebQo=2Fcncp48hPfRfPObXHw=2FaWvPYx8tiFEpl7?= =?us-ascii?Q?0sZCtYA3JT9ANDa+6zMlr5ZhmIJroLhE3ES+Qdz?= =?us-ascii?Q?UHaFSj0z=2Fea4lRJfE=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102536 Subject: [ruby-core:102536] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17591 has been updated by Eregon (Benoit Daloze). I mixed experimental and deprecation warnings in my comment just above, sorry for that. Experimental warnings are already shown in IRB, as they should. I think deprecation warnings should also be shown in IRB/REPLs in general, if a developer tries some code that is deprecated, they should know about it early, rather than having that code break on the next Ruby version. ---------------------------------------- Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default https://bugs.ruby-lang.org/issues/17591#change-90436 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal ---------------------------------------- Various people in #16345 said that: > The issue can be mitigated if all test frameworks enable all deprecation warnings. > The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically. And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2. However, it seems no test frameworks or REPLs actually show deprecation warnings by default! So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0. I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do. Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`. Same for `test/unit` 3.3.4 shipped with 2.7.2. IRB in 2.7.2 does not show deprecated warnings. Same for `pry`. I think ruby-core needs to have a clear message here, like: > All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`. > This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version. > Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`. And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples. P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`. -- https://bugs.ruby-lang.org/