From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MBvjMPNneGBcJQAAgWs5BA (envelope-from ) for ; Thu, 15 Apr 2021 18:21:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CB/CKvNneGA1SAAA1q6Kng (envelope-from ) for ; Thu, 15 Apr 2021 16:21:07 +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 68468257F9 for ; Thu, 15 Apr 2021 18:21:07 +0200 (CEST) Received: from localhost ([::1]:52046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX4jq-00079X-Fj for larch@yhetil.org; Thu, 15 Apr 2021 12:21:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4jm-00079P-8l for guix-patches@gnu.org; Thu, 15 Apr 2021 12:21:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lX4jl-0000HB-W4 for guix-patches@gnu.org; Thu, 15 Apr 2021 12:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lX4jl-0005UC-QR for guix-patches@gnu.org; Thu, 15 Apr 2021 12:21:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47804] [PATCH] lint: Warn about underscores in package names. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Apr 2021 16:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47804 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen , 47804@debbugs.gnu.org Received: via spool by 47804-submit@debbugs.gnu.org id=B47804.161850361621017 (code B ref 47804); Thu, 15 Apr 2021 16:21:01 +0000 Received: (at 47804) by debbugs.gnu.org; 15 Apr 2021 16:20:16 +0000 Received: from localhost ([127.0.0.1]:38966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX4iy-0005Sr-IV for submit@debbugs.gnu.org; Thu, 15 Apr 2021 12:20:16 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:58988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX4iv-0005Sa-1B for 47804@debbugs.gnu.org; Thu, 15 Apr 2021 12:20:10 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id t4L62400j0mfAB4014L7dU; Thu, 15 Apr 2021 18:20:07 +0200 Message-ID: From: Maxime Devos Date: Thu, 15 Apr 2021 18:19:53 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-ZH1G+2Ai8B7rD/0ZjBh8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1618503607; bh=Pr3C7895wLarTMujGQ2O8pTWOXpcgYTX3nMqjnUERrY=; h=Subject:From:To:Date:In-Reply-To:References; b=XUL/cL+hsvTi52+M1fA8VN48E5H1mbfEa22IIA74VGGtS+3CB/qNX+gLS8lReiXvZ /1N/En1DwudtnhGqckPVfpVSmEVDt9aYsK7t6t8t6imhfMCLXl7n/qu2I0RLyiDM0s aIXNsyuQeLGaiunvML2phFz2QVagqqoaJdHoY+XP85O7qhI5swmExQ9Q5AWEv4YZvQ REqk37gGOZefl9YNyaaEcgGU3HqH1vJgPD8O/f3smBf7EJLlJjsejJtL9Wk1vdpFOR nk0iT84MyRQWLb5lUWwZz45YXumEIurNnA0AH4JltbfrQev89VgCL27Zy5N6HvHFqu BzSY2SoJnCtgQ== 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=1618503667; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc: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: dkim-signature; bh=Pr3C7895wLarTMujGQ2O8pTWOXpcgYTX3nMqjnUERrY=; b=GaWcaAx/trPY5JWwciiSeCxojJVuKwtroX2+yQwcNOoGpat4/x44BJSgTYeQsG4cpV3xOC rcz3JwP2SGavFJGnGupovjMyx9JW0kFnzbpUfVxKFNKdWBFDMctvu6qwGj+0lSMgXYd/Di 5N1a/zrB5pg02drYwVmh27/WJvESP5dljc88Dg2QaxmB6/1/iBRX0D1sCQiuxMK/gcytl0 6ODaz5GNtqgSD3fNHbkhKeF0mtoSznu4x1Q/TrCgEYVenhf+RdlE96+MxNkm7USpAAq1bI 3ikfJ4u8c1a2n0lOFx0OiAVI24pales5iVc/Nm2TBwYpNjjN/b7Pk2BmUBzJjw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618503667; a=rsa-sha256; cv=none; b=f31aEP0r2jCVqjaHMDmue7ITqmDTR4+0eE/Pnwz27pM2zEMj+vslRlHEXh9a4ZTzU3U9tA UY8U8IOWXLtZDqaOkzM87VcCLbEtv2w5A3ZcfSUXooffipY9qIxMYImutYrI+MCiHADNrN 8hM/gljkO6bv8i/3qK8cxgpXNFuDSXq23pArqrWfFteNSn7L3FAdeAGtjZ+8FIbmam0EDr dzPU1T9QSDULNAR+r+EKNC2oPNOaCF0B8eE+KvcuE2wqP30oVzRUJVISMSOLo52Mr/AQoK yC5pFnQoTmNyR7i/TyefmlkgytWEcCkg3aXBpxtPJygzwzMAouByZsVeYDcfGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b="XUL/cL+h"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); 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: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b="XUL/cL+h"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); 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: 68468257F9 X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: mbYNH9KA10yJ --=-ZH1G+2Ai8B7rD/0ZjBh8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2021-04-15 at 18:00 +0200, Xinglu Chen wrote: > As per section '16.4.2 Package Naming' in the manual, use hyphens > instead of underscores in package names. >=20 > * guix/lint.scm (check-name): Check whether the package name contains > underscores. > --- > There was some discussion about this on guix-devel[1], but no consensus > was reached. Should we whitelist certain names like =E2=80=9C86_64=E2=80= =9D or something? I dunno. Perhaps for now, we can accept that the 'check-name' linter is sometimes overly strict, and punt the exceptions for later? > [1]: https://yhetil.org/guix-devel/87v991vkpi.fsf@nckx >=20 > guix/lint.scm | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) >=20 > diff --git a/guix/lint.scm b/guix/lint.scm > index a7d6bbba4f..d5ad69475e 100644 > --- a/guix/lint.scm > +++ b/guix/lint.scm > @@ -11,6 +11,7 @@ > ;;; Copyright =C2=A9 2018, 2019 Arun Isaac > ;;; Copyright =C2=A9 2020 Chris Marusich > ;;; Copyright =C2=A9 2020 Timothy Sample > +;;; Copyright =C2=A9 2021 Xinglu Chen > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -173,14 +174,20 @@ > (define (check-name package) > "Check whether PACKAGE's name matches our guidelines." > (let ((name (package-name package))) > - ;; Currently checks only whether the name is too short. > - (if (and (<=3D (string-length name) 1) > - (not (string=3D? name "r"))) ; common-sense exception > - (list > - (make-warning package > - (G_ "name should be longer than a single characte= r") > - #:field 'name)) > - '()))) > + (cond > + ;; Currently checks only whether the name is too short. > + ((and (<=3D (string-length name) 1) > + (not (string=3D? name "r"))) ; common-sense exception > + (list > + (make-warning package > + (G_ "name should be longer than a single character"= ) > + #:field 'name))) > + ((string-match "_" name) > + (list > + (make-warning package > + (G_ "name should use hyphens instead of underscores= ") > + #:field 'name))) > + (else '())))) I didn't test this, but that seems about right. Ideally, you should add a corresponding test in tests/lint.scm (IIRC, maybe the linter tests are elsewhere). However, Guix is currently in the "string freeze", so this cannot yet be me= rged, IIUC. Greetings, Maxime. --=-ZH1G+2Ai8B7rD/0ZjBh8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHhnqRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qHoAQCJkjMTs4202E/7IFSOPxia4GVu 4OHuE4d2j4Vici9O0QEAp56CBgX7ASGNK2RUFme7pCmtXujKI6TxpHcpx/804QE= =pJJG -----END PGP SIGNATURE----- --=-ZH1G+2Ai8B7rD/0ZjBh8--