From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 4ANKItQ1Y2PTgQEAbAwnHQ (envelope-from ) for ; Thu, 03 Nov 2022 04:30:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UP45ItQ1Y2PFmQAA9RJhRA (envelope-from ) for ; Thu, 03 Nov 2022 04:30:28 +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 333FD25D10 for ; Thu, 3 Nov 2022 04:30:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqQvP-00074H-LO; Wed, 02 Nov 2022 23:29:51 -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 1oqQvN-00070D-4F for guix-devel@gnu.org; Wed, 02 Nov 2022 23:29:49 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqQvL-0001Yk-6g for guix-devel@gnu.org; Wed, 02 Nov 2022 23:29:48 -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 50C241AA58 for ; Wed, 2 Nov 2022 20:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1667446184; bh=YfjbeeMxUBLqDvWZEak1JXEhLJoGGeR4mGqLK50IY2c=; h=From:To:Subject:Date:From; b=ntOzpQAXEXnVm3CjdwZEmkobkH4byvtHGMwMYUmKemjPBbE9yvbe6iLir+QjoU+gn eYoRUR54TEKUX63o++A4LEPyeNw434yRCpF5uhTMunWEVKOUVUj5xrylBFYxEMa715 q4bmzivX/x/jiqhlY3PE+emF4c1Oe5gNvDsiW7ofRWloHlvrLLtTIdl3807Fg4O8QD K7TxWCwVd1bzBmGbTtZ7n8l3Ex6k1aVJZTEkdSxHSFh29YdDYoxR2MiVUtccv/B05S hw0BdPOT5Cc39FrjusYvANl2rGJtDCuSSQkqaDJ3hRUIE3vogfwU0S+fijYQRWSMBK /yBnI6JtUzJbA== From: Vagrant Cascadian To: guix-devel@gnu.org Subject: guix lint false positives and RFC patch Date: Wed, 02 Nov 2022 20:29:39 -0700 Message-ID: <87leosd8bg.fsf@contorta> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=173.255.214.101; 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.048, 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=1667446228; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Z1U3rFDcWz4xu7HoWoYfZzPMnKkvda4i3ByAMTGk7tc=; b=Y9UhlGzTdgeC0ZnAeu+AkPMaQDJU2O2Fskc2nlnED4CPb7DlBqF05M/Z/MWattT0xWF+il I6qK/94oKUrPM+H7RHnK/0oqf45hRYVvJCU0oBISB0G+yIBdFQZAu7tsLuoL03DBTTKQAC 1hcajuR1gbJG2wzn25V9xGiBOk9N8zVt+Bq+1UB2Yft8/EwkjuHbVIs7G+mdkAhNe2csdC u+MzXZOH9xa2qSsAaHlm85XqYOqKGMzPx21I/yOdzuLNC6dtnxHa+Cj7c9AHnpT/BPu2t/ WwF2BXxw6dECUuzr50fQ8RP0x4As7aw+7GbNRoFZ9LCCZN4TlNAHT86pzdT+wQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667446228; a=rsa-sha256; cv=none; b=KaxJvoXjnD5/JaVTn5SUogsVPe9PgQP/HHYyHvkubXsa2U2NqbognR7dI7+opPnpUGsTSg AxY5FkrfKkQPphTQdB0H0DyCsMQJR1tXO9agLBwtyhXeIALhCemDE4Kt0f5fzB+eiJKJrA xZcLVkXpmkCOz3sZizUmDC/p7j8SwpHT6MXvVzty/HHc3IfJXCJXvzr3NHlk91F/HZRTT2 5WFiXszdGi5YwrN52dmZU6MYB7UR4Lg3dnji2rJgJ/JtepZkcf9T3SzqDFCbKsl9TbRjcL ZrK1kucCxb+Bl7RrHhtBEwg5pcCjsLg4X7nO54HzevrEq3u26mPcBTN8tvx3qQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b=ntOzpQAX; 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: -9.59 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b=ntOzpQAX; 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: 333FD25D10 X-Spam-Score: -9.59 X-Migadu-Scanner: scn0.migadu.com X-TUID: PqwtlpP4TOdI --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain I've noticed a handful of false positives in guix lint checking descriptions and synopsis, and tracked several down to the use of @code{} and similar. The attached patch partly addresses this, though could definitely be written better (e.g. handling more cases, also stripping out the relevent "}", etc.) This fixes about 11 out of 544 overall guix lint issues with descriptions and synopsis. Had expected it to fix more issues, but I think stripping the "@code{" reveals issues in other checks that were previously hidden.... maybe. I will reiterate that this leaves a lot of room for improvement. :) live well, vagrant --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-guix-lint-Exclude-code-from-various-checks.patch Content-Transfer-Encoding: quoted-printable From=20209c97b91d02831d78fc0b032f3b83fd5e0b9cb1 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 2 Nov 2022 19:56:12 -0700 Subject: [PATCH] guix: lint: Exclude "@code{" from various checks. The visual representation of the relevent 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 "@code{". (check-synopsis-length): Exclude "@code{". =2D-- guix/lint.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 8e3976171f..4dc35218db 100644 =2D-- a/guix/lint.scm +++ b/guix/lint.scm @@ -313,7 +313,8 @@ (define (tests-explicitly-enabled?) '())) =20 (define (properly-starts-sentence? s) =2D (string-match "^[(\"'`[:upper:][:digit:]]" s)) + (string-match "^[(\"'`[:upper:][:digit:]]" + (string-replace-substring s "@code{" ""))) =20 (define (starts-with-abbreviation? s) "Return #t if S starts with what looks like an abbreviation or acronym." @@ -650,7 +651,7 @@ (define check-start-article '())))) =20 (define (check-synopsis-length synopsis) =2D (if (>=3D (string-length synopsis) 80) + (if (>=3D (string-length (string-replace-substring synopsis "@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/If5cWqgUCY2M1pAAKCRDcUY/If5cW qkQNAPwLUcYNlj7VmAXY+aPfWan/wXVUDG6xvOR4AWnwMaNLGgD7BtEjBkoR9QYj ge03pTDKz59ILZ0SGNeDvxNUkET0/Qc= =lBfr -----END PGP SIGNATURE----- --==-=-=--