From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Rw+lAZNkeGBihAEAgWs5BA (envelope-from ) for ; Thu, 15 Apr 2021 18:06:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IDVSNZJkeGAcPQAA1q6Kng (envelope-from ) for ; Thu, 15 Apr 2021 16:06:42 +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 8B02725E3A for ; Thu, 15 Apr 2021 18:06:42 +0200 (CEST) Received: from localhost ([::1]:59040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX4Vt-000476-A6 for larch@yhetil.org; Thu, 15 Apr 2021 12:06:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4RR-0000R9-GD for guix-patches@gnu.org; Thu, 15 Apr 2021 12:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lX4RO-0000Gc-Jy for guix-patches@gnu.org; Thu, 15 Apr 2021 12:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lX4RO-0004zj-Gi for guix-patches@gnu.org; Thu, 15 Apr 2021 12:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47804] [PATCH] lint: Warn about underscores in package names. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Apr 2021 16:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47804 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47804@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161850247119132 (code B ref -1); Thu, 15 Apr 2021 16:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Apr 2021 16:01:11 +0000 Received: from localhost ([127.0.0.1]:38938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX4QZ-0004yW-FM for submit@debbugs.gnu.org; Thu, 15 Apr 2021 12:01:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:52736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX4QW-0004yM-8S for submit@debbugs.gnu.org; Thu, 15 Apr 2021 12:01:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4QN-0008Ks-LO for guix-patches@gnu.org; Thu, 15 Apr 2021 12:01:02 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:44274 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX4QL-0008FM-FR for guix-patches@gnu.org; Thu, 15 Apr 2021 12:00:59 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1618502447; bh=4CTUfwmeMJgVRM64aGe4q8bsDGP7W+gEfsdsFl/MgUo=; h=From:To:Subject:Date; b=rJUixx59NnHLbj8qnmIAtSBT/5RK6v71p+oXJkX/hADLIuQ5WqHDBkGw5CBUvjMyo qcyuEBVnfUHHLcYCW71RJx3s6SibPEY8cWB80aOeOdF8w4cEPa4O/P0I7RrpTOS01E jGz8ps1dU6d0PqRab9DCkrwfILoERww/wCZkGCM0= Message-Id: Date: Thu, 15 Apr 2021 18:00:46 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.5, FROM_SUSPICIOUS_NTLD_FP=0.001, PDS_OTHER_BAD_TLD=1.999, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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=1618502802; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=YMM7xiUzBkawYRK2Um1MzTBHaNLk5WAxSW8/5wVzcZ0=; b=E2hPYyBaBAHN+8MZcCKfeonoJHEQT5xWuDq6vRLTBzTLbZWMOjDxJBiOlTZ+C41RiTJ+F9 GbOZ7yBLdBxXURNUo1YrQ3eUuW3tU2J0bXdYbz0Xj3DZ+ZX49tWJ704qdZfuJccyh2ARl9 1NjWRVxPbJDIeT1j8LbT69noICyhdqtTG6258npwsIE7aHQayihrwTbXgA89/ZPb+CRehb TolR3LXplTcEiZ1OsOTktldf7yqMWdp/XtFRsvpKAmTxe769aK1BpKonR5ACYyJfmv4OuY VGF2Qzz0JvIKvH4WHws85wJYdn5T/SfxJLOyv4DpzpA9RPx32EC8Ire45YZWRw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618502802; a=rsa-sha256; cv=none; b=AemYaWH9oodMbJZRgVI1M3ozvm3V2xDgRjyCSfB/IVeFvEuCWUzSeXVB1SinaFQn1TRaO9 vBPLXe4Zz6S0P2HyU3OnAaoF96782vHx+EGhG4zOX3NE6L7sUTQ5mL1Av/JIB5LakpTpdH AFs9N0TImhRj0W8ERoigOYgYUncQCev2Ctq0duiV1KlvWy+P84pFmrb8hNscL/S9pVNh3k PGRyqUjvI6IMFXZEdrxXYq71/ZO4lApmrAnz2GhdAFdkg99Vbw2jaHdtD+/M0JQFQj9AyW Hie8MwlyPfFsKqqGudlWOnHsSIyNt3ruwZTdSNUo/ua6E71YgUucEGoM5+N//w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=rJUixx59; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (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: -0.34 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=rJUixx59; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (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: 8B02725E3A X-Spam-Score: -0.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: trHYy2wcedYa 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. --- 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? [1]: https://yhetil.org/guix-devel/87v991vkpi.fsf@nckx guix/lint.scm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) 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 character") - #: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 '())))) =20 (define (properly-starts-sentence? s) (string-match "^[(\"'`[:upper:][:digit:]]" s)) base-commit: a5bbd38fd131282e928144e869dcdf1e09259085 --=20 2.31.1