From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 21 19:18:47 2021 Received: (at 44675) by debbugs.gnu.org; 21 Oct 2021 23:18:47 +0000 Received: from localhost ([127.0.0.1]:58909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdhKh-0003de-Hp for submit@debbugs.gnu.org; Thu, 21 Oct 2021 19:18:47 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:40348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdhKg-0003dP-7C for 44675@debbugs.gnu.org; Thu, 21 Oct 2021 19:18:46 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id E7FD21AA2C; Thu, 21 Oct 2021 16:18:39 -0700 (PDT) From: Vagrant Cascadian To: 44675@debbugs.gnu.org Subject: Re: bug#44675: guix lint: support for spellchecker or basic grammar In-Reply-To: <87zgvz129e.fsf@yucca> References: <87ima6rrri.fsf@yucca> <87tunznsi7.fsf@yucca> <2f3077c0d040e4b40db19d98195845e124b064d3.camel@telenet.be> <87o8e6nqvv.fsf@yucca> <87o8dqmozo.fsf@gnu.org> <87zgvz129e.fsf@yucca> Date: Thu, 21 Oct 2021 16:18:34 -0700 Message-ID: <8735ouotkl.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44675 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , Maxime Devos , Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2021-06-09, Vagrant Cascadian wrote: > There have been at least three newly added "This packages" since I > submitted this patch, so wondering if we can at least get the simple > case merged before getting too caught up in all the potential > improvements? And up until today, that list grew to 7! (fixed by=20 Long delayed updated patch ... I think it addresses almost all of the issues brought up, and maybe introduces a few new ones! It has been rewritten to easily add new typo checks, but this one so far only addresses pluralized "This packages". Would be easy enough to add "allows to" but hard to add a suggested fix... Big thanks to rekado, vivien and nckx who helped via #guix IRC! live well, vagrant --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-lint-Add-description-check-for-pluralized-This-packa.patch Content-Transfer-Encoding: quoted-printable From=203ab46ca7932614ab4c699512c2fbfa8207ffa964 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 21 Oct 2021 15:51:11 -0700 Subject: [PATCH] lint: Add description check for pluralized "This package" Partial fix for: https://issues.guix.gnu.org/44675 * guix/lint.scm (check-description-typo): Add check for occurances of "This packages" in package descriptions. * tests/lint.scm: Add test. =2D-- guix/lint.scm | 12 ++++++++++++ tests/lint.scm | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/guix/lint.scm b/guix/lint.scm index 7b02b9cec0..b22454fd31 100644 =2D-- a/guix/lint.scm +++ b/guix/lint.scm @@ -321,6 +321,17 @@ markup is valid return a plain-text version of DESCRIP= TION, otherwise #f." (G_ "Texinfo markup in description is invalid") #:field 'description)))) =20 + (define (check-description-typo description typo correction) + "Check that DESCRIPTION does not contain typo, with optional correctio= n" + (if (string-contains description typo) + (list + (make-warning package + (G_ + (format #false + "description contains typo '~a'~@[, should= be '~a'~]" + typo correction)))) + '())) + (define (check-trademarks description) "Check that DESCRIPTION does not contain '=E2=84=A2' or '=C2=AE' chara= cters. See http://www.gnu.org/prep/standards/html_node/Trademarks.html." @@ -401,6 +412,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") (check-not-empty description) (check-quotes description) (check-trademarks description) + (check-description-typo description "This packages" "This package= ") ;; Use raw description for this because Texinfo rendering ;; automatically fixes end of sentence space. (check-end-of-sentence-space description) diff --git a/tests/lint.scm b/tests/lint.scm index 699a750eb9..1902a87354 100644 =2D-- a/tests/lint.scm +++ b/tests/lint.scm @@ -177,6 +177,13 @@ (description "Whitespace. ")))) (check-description-style pkg)))) =20 +(test-equal "description: pluralized 'This package'" + "description contains typo 'This packages', should be 'This package'" + (single-lint-warning-message + (let ((pkg (dummy-package "x" + (description "This packages is a typo.")))) + (check-description-style pkg)))) + (test-equal "synopsis: not a string" "invalid synopsis: #f" (single-lint-warning-message =2D-=20 2.30.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYXH1SwAKCRDcUY/If5cW qvtEAP9hlcihBOeEnrbS6zZjgdxG84VvbfSVPK6KtvLt0Di1/wD+MxXNMtIeRn7h uJZQ50L0D3MKsoJoZnfKQcG9CprXjQ0= =YK9i -----END PGP SIGNATURE----- --==-=-=--