From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YJvZIO75eWBSlQAAgWs5BA (envelope-from ) for ; Fri, 16 Apr 2021 22:56:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MDEQG+75eWCsVQAAbx9fmQ (envelope-from ) for ; Fri, 16 Apr 2021 20:56:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 33C85207AA for ; Fri, 16 Apr 2021 22:56:14 +0200 (CEST) Received: from localhost ([::1]:40854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXVVd-000378-8m for larch@yhetil.org; Fri, 16 Apr 2021 16:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXVVS-00032d-Eu for guix-patches@gnu.org; Fri, 16 Apr 2021 16:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXVVS-0005Lq-7F for guix-patches@gnu.org; Fri, 16 Apr 2021 16:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lXVVS-0004Nw-5A for guix-patches@gnu.org; Fri, 16 Apr 2021 16:56:02 -0400 Subject: bug#47804: [PATCH] lint: Warn about underscores in package names. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Fri, 16 Apr 2021 20:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 47804 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen Cc: 47804-done@debbugs.gnu.org, Maxime Devos Mail-Followup-To: 47804@debbugs.gnu.org, ludo@gnu.org, public@yoctocell.xyz Received: via spool by 47804-done@debbugs.gnu.org id=D47804.161860650616779 (code D ref 47804); Fri, 16 Apr 2021 20:56:01 +0000 Received: (at 47804-done) by debbugs.gnu.org; 16 Apr 2021 20:55:06 +0000 Received: from localhost ([127.0.0.1]:41801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXVUY-0004MY-3X for submit@debbugs.gnu.org; Fri, 16 Apr 2021 16:55:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXVUS-0004Ly-Tu for 47804-done@debbugs.gnu.org; Fri, 16 Apr 2021 16:55:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48305) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXVUK-0004af-7T; Fri, 16 Apr 2021 16:54:54 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39876 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lXVUH-0004nW-LF; Fri, 16 Apr 2021 16:54:50 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <94d0b8cb2322ed634442c0ebb79589e5dc05e526.1618511382.git.public@yoctocell.xyz> Date: Fri, 16 Apr 2021 22:54:47 +0200 In-Reply-To: <94d0b8cb2322ed634442c0ebb79589e5dc05e526.1618511382.git.public@yoctocell.xyz> (Xinglu Chen's message of "Thu, 15 Apr 2021 20:31:44 +0200") Message-ID: <87eefa2bmw.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618606574; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=J/XDd3UU2rE7EpTqyyBmJHsvIHxbV1M55kVNISj4S6U=; b=e/uE/l7KeA7l46YxqSzJybes8UFnd2O7sHfIoiGG+3N+Eynj24HNGiMYxjIDdi094rSgbk 8u4Q6ror7ONZfqXcBKSZeOAyYb5Sj9O25Lv+s6EVz05e3e59E1VYPa5EHuj0yvZ8oQ4CnM XLVHF1kCX7PUIhbKTgE+A+2GlEAX954wMr0B2XzT8ZDgbGcsLCce01hfx+Ro2BeZb2/SNT R+98W1pLckWkS5nNqwxj2/9jbo/8HwXsHdECVV682E6uS2dqOadCV8sceQBNxvqlxCH/NT 5alhdry6LztFTBov3p8Butrtg97kXAGnfbWZoStYXKyPUvzMlbLn5vSPf4GB1A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618606574; a=rsa-sha256; cv=none; b=WoT1dBXTOguYdU+MAPUgsQNgK3rcpgiqlmcGnwivhh4lR4CgqP849rH7yaXBywU+iPbpgU JHwmUa8yXfX7aW5vlsPIbvfQUizgjt+JC955kGW4O/LOejjMocEMlArNc/R+ePSWaPVoJy dtCok2iVup6RjvjCLpvl5UIS84Wcn0tyLP07pGKlsV7j6j/HX+xHNQiIBa0K5zhY4y9LsD UjXLG5jB27LQSoTkgjyNs7Pvg0pJjiUUISRz3ojcIhjzaoW9HY9z2M47kz+wIKeAtq5VDg 5St0ztEBH5YvFuRLwY8TJYEGYp8/8TXGSIggIpxe3mGDC/JQ3R5cL+Hz5tJEFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 33C85207AA X-Spam-Score: -2.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: Lz/mlkFxejoX --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Xinglu Chen skribis: > As per section '16.4.2 Package Naming' in the manual, use hyphens > instead of underscores in package names. > > * guix/lint.scm (check-name): Check whether the package name contains > underscores. > * tests/lint.scm ("name: use underscore in package name"): New test. Applied with the minor change below, which avoids regexps (=E2=80=98string-match=E2=80=99 performs regexp matches, which is overkill = here). Thank you and thanks Maxime for the review! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/lint.scm b/guix/lint.scm index 38699e2927..1bebfe03d3 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -183,7 +183,7 @@ (make-warning package (G_ "name should be longer than a single character") #:field 'name))) - ((string-match "_" name) + ((string-index name #\_) (list (make-warning package (G_ "name should use hyphens instead of underscores") --=-=-=--