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 sBkROYxOcGOWVQEAbAwnHQ (envelope-from ) for ; Sun, 13 Nov 2022 02:55: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 mp11.migadu.com with LMTPS id H7EVOYxOcGOIfgAA9RJhRA (envelope-from ) for ; Sun, 13 Nov 2022 02:55:24 +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 A57699680 for ; Sun, 13 Nov 2022 02:55:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ou2D5-0004er-WC; Sat, 12 Nov 2022 20:55:00 -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 1ou2D4-0004eO-M4 for guix-devel@gnu.org; Sat, 12 Nov 2022 20:54:58 -0500 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 1ou2D2-0000V1-IW; Sat, 12 Nov 2022 20:54:58 -0500 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 0B0991AAB8; Sat, 12 Nov 2022 17:54:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1668304485; bh=A30t2QJ8iUcqOuIi6SjPMVHmBo0XRCSJ2NDRNBFZWZU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=aJj4vXzz5+dg8U4BB38vNQgrqvCqV/hvdqu2VMKMKOvPKSrOJGRSP0MPgNPhQElhc EJO+Nr3D8fEZObQJBlr4FXwNzpjzoC/4E9aLQXsIVsERzAigpbLWft6M10hZD+3SCj 3kYxiwHlCJSLGY9nV9/zPhojwjBD/BiTNpSLL3mT0GuvyoccZrAkED6ezP+lHdshky Wnl0ZcerIlW66oZlQrF38pAT1bc3lsHWoidFHrRk4bzjmX7C7Ic8qieap0di+/5c3L +WHAD5XbQUuqoI0hzM7Xyd3UUV6O18mUpKCSl42L3BwinG+nhvdqb3D6r+mbdc5i4+ eHKeJNco+LAVg== 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: <87k049jnl9.fsf@gnu.org> References: <87leosd8bg.fsf@contorta> <87tu3goyia.fsf@gnu.org> <877d0beh4i.fsf@contorta> <87leoqcq8p.fsf@contorta> <87k049jnl9.fsf@gnu.org> Date: Sat, 12 Nov 2022 17:54:36 -0800 Message-ID: <87v8njliub.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: 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=1668304524; 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=zp0fG+moLt+YHFcw5ODoG/mdtZlxGxIzXQsVCtJetFQ=; b=M8U6m90PTfgjE/Yy+zOYXxWZhqHK4aAQgdTSJCto5aHAALqHVS73ycePFrY8X6fukqRACm sRv5M2GXVzEQu76r+VKsyZgVO5U5pIwSd5NQmAQqL7le6uOA34EUJznOcrejCU6qygO46R RLzlJHF0ySZ19OiPDJfkf+gZ8ZjmQsQVHIGAPudKmwq5qJfokJjZHlE7qqgCD980OoQDQQ A8HEIugZTJRv4fVepN2iWepwUbM9v2jt2Wh6eJ/QvuOxOtyHEsrtBG0HslpN1YDV7ypySl vPI7gcih0tAsY4nNtYaKRL4GedFhQXs8+g+D+2jBLO2wBtZrzQElSHZDeUL7kg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668304524; a=rsa-sha256; cv=none; b=SANI2l89c43eylRcQPgu6Ha2OwswHx/NkMEWn9mE01ccIDLtYwAcrVBFW2UHrf7YQ4r64n sRPEtLghjn51+bM4A1futOfvOxCnOLRNM9xwi/C3piFmK7SHQve15qUZMsdX7OflrPbxvE Fm2E47Iuiu2anqbp1LgMlN/DJhqwMoDeiSnFneg436qA+9XNdk+8TP4/dV88xi/vtsTlAD mkS8lq18kL4nQOT+c7c6AhkVsE8woaq3TrJkt/I92EXrnFTI4ADppC6LvuNUlPYYLl1Sal YHqPf94GUtQN2loNGsGtFXa4m3lHQz/19KyUNNXMv3Wgk6YAIhDAl7ngGlIkBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b=aJj4vXzz; 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: -10.94 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b=aJj4vXzz; 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: A57699680 X-Spam-Score: -10.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: uYEPjVq8QU7O --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-11-05, Ludovic Court=C3=A8s wrote: > Vagrant Cascadian skribis: >> From bfa13fdd3616839883e50efbbc05fb132610ce67 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 f= alse >> positives. >> >> FIXME handle @command, @file, @acronym, etc. >> >> * guix/linx.scm (properly-starts-sentence): Exclude leading "@". >> (check-synopsis-length): Exclude "@code" and "@acronym". > > LGTM! Bonus points for a test in =E2=80=98tests/lint.scm=E2=80=99. :-) No bonus points for me just yet... diff --git a/tests/lint.scm b/tests/lint.scm index ce22e2355a..26e93ca37b 100644 =2D-- a/tests/lint.scm +++ b/tests/lint.scm @@ -283,6 +283,16 @@ (define (warning-contains? str warnings) (synopsis (make-string 80 #\X))))) (check-synopsis-style pkg)))) +(test-equal "synopsis: exclude @code from long synopsis" + '() + (single-lint-warning-message + (let ((pkg (dummy-package "x" + (synopsis + (string-append + "@code{X}" + (make-string 72 #\X)))))) + (check-synopsis-style pkg)))) + (test-equal "synopsis: start with package name" "synopsis should not start with the package name" (single-lint-warning-message The above test doesn't catch this issue, even though the code works on real packages... I am a bit stumped as to why. I guess '() (or "" which I also tried) is not a valid way to try to express "this test expects no warning/error/message/etc."? Here is a log from the test I cargo-culted: test-name: synopsis: too long location: /home/vagrant/src/guix/tests/lint.scm:279 source: + (test-equal + "synopsis: too long" + "synopsis should be less than 80 characters long" + (single-lint-warning-message + (let ((pkg (dummy-package + "x" + (synopsis (make-string 80 #\X))))) + (check-synopsis-style pkg)))) expected-value: "synopsis should be less than 80 characters long" actual-value: "synopsis should be less than 80 characters long" result: PASS And from my test in the patch listed above: test-name: synopsis: exclude @code from long synopsis location: /home/vagrant/src/guix/tests/lint.scm:286 source: + (test-equal + "synopsis: exclude @code from long synopsis" + '() + (single-lint-warning-message + (let ((pkg (dummy-package + "x" + (synopsis + (string-append "@code{X}" (make-string 72 #\X)))))) + (check-synopsis-style pkg)))) expected-value: () actual-value: #f actual-error: + (match-error "match" "no matching pattern" ()) result: FAIL What is failing to match what here? live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCY3BOXgAKCRDcUY/If5cW qtMZAQDn6QO8gvI7UARdXJ6bBRF4Kf2beai0Mzw4A8Lm+pbyggEA2Fzy+dm+xM4a jaCtvqsklNDa9Ppz4SdRod+5xu/W9A0= =2w7V -----END PGP SIGNATURE----- --=-=-=--