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=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham 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 2003E1F4B4 for ; Fri, 25 Sep 2020 04:58:37 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 08232120AC6; Fri, 25 Sep 2020 13:57:58 +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 9636A120AC0 for ; Fri, 25 Sep 2020 13:57:55 +0900 (JST) Received: by filterdrecv-p3las1-6f66587546-p2bh5 with SMTP id filterdrecv-p3las1-6f66587546-p2bh5-19-5F6D78E5-2F 2020-09-25 04:58:13.637008195 +0000 UTC m=+284378.624789314 Received: from herokuapp.com (unknown) by geopod-ismtpd-3-3 (SG) with ESMTP id iRv4alBYT5KoQmRtrxFBvg for ; Fri, 25 Sep 2020 04:58:13.351 +0000 (UTC) Date: Fri, 25 Sep 2020 04:58:13 +0000 (UTC) From: matz@ruby.or.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75959 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17143 X-Redmine-Issue-Author: jeremyevans0 X-Redmine-Sender: matz 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?bXEIHGfdFwsIlBTndiToCp=2Fmc2rfxRD2sZAksRKJIHWWOpm=2FXOJUf2PPUSO0aU?= =?us-ascii?Q?GHygp65UjfDkz2dWr=2FVWMY+VQEEvGlQq3wi+2Ie?= =?us-ascii?Q?rq3owYzzkQbkx15=2FBXV1t5kQH6GqWkK8yPnlxqA?= =?us-ascii?Q?j1UnMSOQ9meW9MWzg2Ot7kwjtfe=2FDagtKdQzeWi?= =?us-ascii?Q?eSSamKcXCQ5vGgb5n1RCbEm+oXXTS2KYs8pHFqX?= =?us-ascii?Q?RXt3EiNmRqSuDrW8Q=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 100119 Subject: [ruby-core:100119] [Ruby master Feature#17143] Improve support for warning categories 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 #17143 has been updated by matz (Yukihiro Matsumoto). Adding category to the warning seems a good idea. But I have the following concerns: * Category should be specified only by symbols * Category symbols must be among predefined set (to avoid typos and confusions) Matz. ---------------------------------------- Feature #17143: Improve support for warning categories https://bugs.ruby-lang.org/issues/17143#change-87687 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Priority: Normal ---------------------------------------- Support was recently added for Warning.warn to accept a `category` keyword. However, the initial implementation was limited to having `rb_warn_deprecated` and `rb_warn_deprecated_to_remove` use the `:deprecated` value for the `category` keyword. It doesn't make sense to me to have a `category` keyword if it is only used for deprecation, so I propose we extend the support so that `Kernel#warn` accepts a category keyword (for Ruby-level warnings) and `rb_category_warn` and `rb_category_warning` functions be added to the C-API (for C-level warnings). I also propose that we change existing `rb_warn` and `rb_warning` calls to `rb_category_warn` and `rb_category_warning`, so that all warnings issued by core Ruby are issued with an appropriate category. I have implemented support for this in a pull request: https://github.com/ruby/ruby/pull/3508 -- https://bugs.ruby-lang.org/