From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oWwDLVWRZWNOawAAbAwnHQ (envelope-from ) for ; Fri, 04 Nov 2022 23:25:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CPEWLFWRZWMeAgAAauVa8A (envelope-from ) for ; Fri, 04 Nov 2022 23:25:25 +0100 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 7BD8BB449 for ; Fri, 4 Nov 2022 23:25:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1or57W-0007Qz-Ac; Fri, 04 Nov 2022 18:25:04 -0400 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 1or57M-0007O8-DP for guix-devel@gnu.org; Fri, 04 Nov 2022 18:24:52 -0400 Received: from cascadia.aikidev.net ([2600:3c01:e000:267:0:a171:de7:c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1or57J-00008o-Rj; Fri, 04 Nov 2022 18:24:52 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:7:77:0:20]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 343451AA98; Fri, 4 Nov 2022 15:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1667600683; bh=UqUK5hDCKAHhc6JInoIh8WD1AkAKMFGxJssfJoOuC3M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VZpnLaALtQ0oi3i7c0DxJxqwr87wycydI7dwmgHnrxflL6Ts6UM3L2YSNoOyXd7Iw huaAkRRYQwbfcnHEIKWPmCd3SOisEitMU2xCS1PkJ44QKXIruHvjhSekMQbJR/S2B2 QlN2JBdHmlEVTHScd0xEHsZpPEzoEOpr8LVlfwaTp0ZVBa4TXQC3qrf1sPOUImyPzf crEKVmIx8Av8ZOQHEw8oGGOb65VxUW+ChYW6VrP7h1i8q9hsw7hcTZsxxa3+4TtyEg rCIobcaDkQIAl12SdEIUia2OHHvhz6sxglpmAk/k3NbPbYQUl6nLMrAZICdetCUX4p vDu/JmqaJGEuA== From: Vagrant Cascadian To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Subject: Re: guix lint false positives and RFC patch In-Reply-To: <877d0beh4i.fsf@contorta> References: <87leosd8bg.fsf@contorta> <87tu3goyia.fsf@gnu.org> <877d0beh4i.fsf@contorta> Date: Fri, 04 Nov 2022 15:24:38 -0700 Message-ID: <87leoqcq8p.fsf@contorta> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=2600:3c01:e000:267:0:a171:de7:c; envelope-from=vagrant@debian.org; helo=cascadia.aikidev.net X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.045, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-devel" Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667600725; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Q50dfo85g1qx2nTk63be4bCrVfwaVY+YgaRvQUFeMAY=; b=h3c3tXehFzCM3B/tcUtmTXD0Sudo4pqwe9ydveGbZdmnnLwJzLLsc4p8+X87KRzp8Kz0Wp 7jDeWGLaS/goyr6mir8UIjrFBdSxnfu/ELWF7VqlXEX2PWf2ARf9uAdo/WyXtt9CRlUM2F 0U0nMFRGw8Bfp0rFQEsK5kzThrtsJGe3nBKsWFvSmG+FpBrZ7KB0OmHl/O7tHK8FkymBfV vT1/YTEMAQmEr1drZF0YudCqUiAptaQPxlBKoKi8UbU1azVdZXhD44dUKEP6dXDb5PIjZu NOb5mWKFCxw/BRtpKJEqCmL/fbUz05uJAX6GtSsuYB/oEMcIwnLsx4jijbjN4A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667600725; a=rsa-sha256; cv=none; b=hhZykF5uTyfWFGSZkzaoEqfV/gul5AVDC1uuU++J4dwgdCSCmu8tmh2gjKwx4xbTIYANpH 817AY99RgAMc1NAbRqBI0idDVxBBiXb9Lv+XPLl13Mf6MVWmUmHrtBeQ5ss6XTNM+lk7uG QGVV6OnZhdRX3SNrNu0gMqOA4FLZHGyCmpi+BDZ0a2ql38vevEGLJeQB9gq9h9IyEac6l9 3V442Y+UwRhisR1D+hnzvIjD++1NsPX3Uwp2JTAZciR+K7BRcvWqGF63u14nRaF32oiyKL KZ39J9awJm1l9aTpz2u9a7mqVnx1WGdxhMjgZh3Cx5O3+hBD3+kYcO1j/pIPuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b=VZpnLaAL; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b=VZpnLaAL; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7BD8BB449 X-Spam-Score: -7.10 X-Migadu-Scanner: scn1.migadu.com X-TUID: jYRc2ROsoXVF --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-11-03, Vagrant Cascadian wrote: > On 2022-11-03, Ludovic Court=C3=A8s wrote: >> Vagrant Cascadian skribis: >> >>> --- a/guix/lint.scm >>> +++ b/guix/lint.scm >>> @@ -313,7 +313,8 @@ (define (tests-explicitly-enabled?) >>> '())) >>>=20=20 >>> (define (properly-starts-sentence? s) >>> - (string-match "^[(\"'`[:upper:][:digit:]]" s)) >>> + (string-match "^[(\"'`[:upper:][:digit:]]" >>> + (string-replace-substring s "@code{" ""))) >> >> An identifier in @code or file name in @file may legitimately start with >> a lower-case letter so I don=E2=80=99t think we should try to prevent th= at. >> >> However, maybe we could change the regexp above to something that >> accepts @ or some other non-letter character at the start? > > Great suggestion, as it is simpler, easier to read, and actually covers > more false positives! Updated patch attached! > > I think there was only one case fixed by the @code{} check for the > synopsis length check, and I don't see any obvious other @*{} checks > that would currently improve anything, though it would be ideal to make > it more future-proof just in case... though I think my attempt at that > would be awfully ugly, help from others would be welcome! Well, ugly is what I have... Found two packages affected by @acronym. Also realized that it should leave the {} in the length-matching, as they are typically replaced by other characters when rendered. > That said, I think this resolves 52 false positives with guix lint (~10% > of the 536 synopsis/description issues currently). Think with this applied there are 54 false positives fixed. live well, vagrant --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-guix-lint-Exclude-some-symbols-from-various-checks.patch Content-Transfer-Encoding: quoted-printable From=20bfa13fdd3616839883e50efbbc05fb132610ce67 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 2 Nov 2022 19:56:12 -0700 Subject: [PATCH 01/12] guix: lint: Exclude some "@" symbols from various checks. The visual representation of "@code{}" or similar in the description and synopsis do not include the string, so exclude it from checks to avoid false positives. FIXME handle @command, @file, @acronym, etc. * guix/linx.scm (properly-starts-sentence): Exclude leading "@". (check-synopsis-length): Exclude "@code" and "@acronym". =2D-- guix/lint.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 8e3976171f..76b17b297d 100644 =2D-- a/guix/lint.scm +++ b/guix/lint.scm @@ -313,7 +313,7 @@ (define (tests-explicitly-enabled?) '())) =20 (define (properly-starts-sentence? s) =2D (string-match "^[(\"'`[:upper:][:digit:]]" s)) + (string-match "^[@(\"'`[:upper:][:digit:]]" s)) =20 (define (starts-with-abbreviation? s) "Return #t if S starts with what looks like an abbreviation or acronym." @@ -650,7 +650,10 @@ (define check-start-article '())))) =20 (define (check-synopsis-length synopsis) =2D (if (>=3D (string-length synopsis) 80) + (if (>=3D (string-length (string-replace-substring + (string-replace-substring synopsis "@acronym" = "") + "@code" "")) + 80) (list (make-warning package (G_ "synopsis should be less than 80 characters lon= g") =2D-=20 2.35.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCY2WRJwAKCRDcUY/If5cW qi35AQCnv1CPMpW9pQIkYu5CCfdn4kWOSToe14xGJELP2b+vRwD+NcnyE++xPbTC 7EGh/JihkxCXzi+jlQCota6kM4hQtQA= =CuP0 -----END PGP SIGNATURE----- --==-=-=--