From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id yFVnG9nHSWe5KQEA62LTzQ:P1 (envelope-from ) for ; Fri, 29 Nov 2024 13:55:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id yFVnG9nHSWe5KQEA62LTzQ (envelope-from ) for ; Fri, 29 Nov 2024 14:55:37 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=b7jA0Lhb; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=DCdOmHf8; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" 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 2798F76E03 for ; Fri, 29 Nov 2024 14:55:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH1Sa-0007OU-Ir; Fri, 29 Nov 2024 08:55:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH1SY-0007O7-M8 for guix-patches@gnu.org; Fri, 29 Nov 2024 08:55:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tH1SY-0004Xq-CK for guix-patches@gnu.org; Fri, 29 Nov 2024 08:55:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=uRqHh8q6+WVeEzXWTz4nC/em5bs5U91gMcMzF69IoRo=; b=b7jA0LhbkaeExp6IntObrZk/bGxsaaYrGFc3UifGlDyCaiPkBrxJOno3m+xduPNBU4vSA010oj8xRPJ/FYs2V0M406P/rjTQb5FL5nA5R7PHqOkDK5xqm+HSS3nqrOMCrKXEtSPhxFZIz0JHjav3ieOXE7UTksXTNRIuDa2HJaKMphlw9TWpHdTNfqk2l9ji30kVrJcSgNlQlVLqCNKijrkMYeyf+FBnL3FsoEeLgEP5h2e+ZzyK66VOZllt0SOuGkTjAflfBKHtViwW0TpD4DZlYeOQYSu+PM/BLCKf5X3NBE5ES6tb+yxLWCKt1Gpw2JGQuwuJmAv2+wa03Ld51Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tH1SX-0001MF-U1 for guix-patches@gnu.org; Fri, 29 Nov 2024 08:55:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 2/8] guix: lint: Refine description start check logic. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 29 Nov 2024 13:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74459 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Gabriel Wicki Cc: 74459@debbugs.gnu.org Received: via spool by 74459-submit@debbugs.gnu.org id=B74459.17328884605158 (code B ref 74459); Fri, 29 Nov 2024 13:55:01 +0000 Received: (at 74459) by debbugs.gnu.org; 29 Nov 2024 13:54:20 +0000 Received: from localhost ([127.0.0.1]:41551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tH1Rr-0001L7-R7 for submit@debbugs.gnu.org; Fri, 29 Nov 2024 08:54:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tH1Rn-0001Kg-6B for 74459@debbugs.gnu.org; Fri, 29 Nov 2024 08:54:18 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tH1Rf-0003uW-0X; Fri, 29 Nov 2024 08:54:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=uRqHh8q6+WVeEzXWTz4nC/em5bs5U91gMcMzF69IoRo=; b=DCdOmHf8XZHbKWMziwtu MDafF+oqP1jXPRNz06VHFDwQmcwqwXyfXIEJPZjK3DQRR87cbRiKA5jkVk7xF4wFfay/O5Yr+EAhz K3YEDzjc0JVOOmybDgwih+XaVw5BLS3FmyH13xR2tOCRT7pDq2ys4H+m/OxXgKf7BDevrqeOWMjvf etX7xvYgHB2ffhhLbDaMsso3zLJ+3Yit1vVpVqeWM06KlO1f18iX4dOGXqS9AeWRSYJoSXHKE1Xjp g1OpB0gfuCkUb9rrBiFT/F0GtvDaSLLKAlzIgqi8gufZ/FivceKeQ/QepkMqSG9vaZtJJBZPhLcsp 7WlzRUEF2cdgTA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: (Gabriel Wicki's message of "Thu, 21 Nov 2024 13:44:52 +0100") References: Date: Fri, 29 Nov 2024 14:54:00 +0100 Message-ID: <874j3q16yv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -7.31 X-Spam-Score: -7.31 X-Migadu-Queue-Id: 2798F76E03 X-Migadu-Scanner: mx10.migadu.com X-TUID: aw2QOYROZ+F2 Hi, Gabriel Wicki skribis: > Fix linter warnings for the following: > > - packages that belong to some programming language or ecosystem, > e.g. python-foo or texlive-bar, > - packages whose names end in a version distinction, e.g. wlroots-0.16 a= nd > - packages where the software's real name contains an underscore `_' > character where our package name replaced that with a hyphen `-', > e.g. wpa_supplicant and wpa-supplicant-minimal. > > * guix/lint.scm (check-description-style)[check-proper-start]: Add condit= ions. > * tests/lint.scm: New tests. > > Change-Id: Ifc9f5cda04db59e460e287cd93afae89c7f17e3c [...] > (define (check-proper-start description) > - (if (or (string-null? description) > - (properly-starts-sentence? description) > - (string-prefix-ci? (package-name package) description)) > - '() > - (list > - (make-warning > - package > - (G_ "description should start with an upper-case letter or dig= it") > - #:field 'description)))) > + (let* ((initial (car (string-split description #\space))) In general we try to avoid =E2=80=98car=E2=80=99 and =E2=80=98cdr=E2=80=99: https://guix.gnu.org/manual/devel/en/html_node/Data-Types-and-Pattern-Mat= ching.html But also, instead of traversing all of =E2=80=98description=E2=80=99, perha= ps you could have something like (untested): (define (first-word str) (let* ((str (string-trim str)) (length (or (and=3D> (string-index str #\space) 1+) (string-leng= th str)))) (string-take str length))) Ludo=E2=80=99.