From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mBlIKRixgGD1xgAAgWs5BA (envelope-from ) for ; Thu, 22 Apr 2021 01:11:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cM3UJBixgGDJPgAAbx9fmQ (envelope-from ) for ; Wed, 21 Apr 2021 23:11:20 +0000 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 193BA223D7 for ; Thu, 22 Apr 2021 01:11:20 +0200 (CEST) Received: from localhost ([::1]:44664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZM06-00082o-Ug for larch@yhetil.org; Wed, 21 Apr 2021 19:11:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZLzq-00081p-GS for bug-guix@gnu.org; Wed, 21 Apr 2021 19:11:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZLzq-0004qn-93 for bug-guix@gnu.org; Wed, 21 Apr 2021 19:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZLzq-0003a9-3Y for bug-guix@gnu.org; Wed, 21 Apr 2021 19:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44675: guix lint: support for spellchecker or basic grammar Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Apr 2021 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44675 X-GNU-PR-Package: guix X-GNU-PR-Keywords: easy To: 44675@debbugs.gnu.org Received: via spool by 44675-submit@debbugs.gnu.org id=B44675.161904665313754 (code B ref 44675); Wed, 21 Apr 2021 23:11:02 +0000 Received: (at 44675) by debbugs.gnu.org; 21 Apr 2021 23:10:53 +0000 Received: from localhost ([127.0.0.1]:60061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZLzh-0003Zl-62 for submit@debbugs.gnu.org; Wed, 21 Apr 2021 19:10:53 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:45518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZLze-0003ZY-DA for 44675@debbugs.gnu.org; Wed, 21 Apr 2021 19:10:52 -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 0A6821AAB4 for <44675@debbugs.gnu.org>; Wed, 21 Apr 2021 16:10:44 -0700 (PDT) From: Vagrant Cascadian In-Reply-To: <87ima6rrri.fsf@yucca> References: <87ima6rrri.fsf@yucca> Date: Wed, 21 Apr 2021 16:10:40 -0700 Message-ID: <87tunznsi7.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619046680; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=6z3os0mcaFQtaQ06OnatMjKRoRVP6KFee+SL3F4p8lU=; b=OVA91+DFuHFnSP6Sr5unh14t6XvTv0KBJppWxygdpo/PT4IfpIDEs5Hbj9tgOpYB2kRZo2 PtY0mYCC64SKAZDHuDSakGa1vDBmrT7vXuaRwyHSyLlBTMUcBGiFo8B2cZCt5vYrVf2PDd WSlXz7mEYpb0NGJG4EpXBHSyclUA7o2L0brasm5Os613v4ifvILJcq+kvP3Oqqqdbnm0pl MOWl8QCbpP7fPJnj1oxo/6K+eC1yy1/7BR/eQ0/D2acaqWtdVm6FCL5gVEqwC5lTcEVLci mlQJvqmpU0HlqGZ+85tXG4UAUrgdW83kYC7pjlo6Izfd/vuU3VhnT74H1zZ2qw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619046680; a=rsa-sha256; cv=none; b=b+CCtr+mHhLI2p0mvUcb1IrZgqeMs/azWXEqI9gSgqriOe+22+MOC/GnjoY/IkFzfy969q PawnqiM6O+cVfH4AvHZAYazvBb6BwR32qdYUAMBVWB2lUsfQywlbmT+J2VmpGRiWsUuB7T CLR0j7eCxC9n8EHNxaD8e3Mk2N0d5MCWWjFkT90rZDzgClGWdPTYSaWses3RgsTYi3YXaB TA3b9VxKmoZWMQpGDZz6laMOMWAWJv553qkdYs6MRmS/Wo2b4HWBSRWDtvN+XHb/q2ajff ZrpG0dc7Smcbqxk4XrFlkgZfiEFGm5STXne6bvcDpFazqvDbMmw78RQrItf0UA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.54 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 193BA223D7 X-Spam-Score: -2.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: LLU35369XZx3 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Control: tags 44675 +patch On 2020-11-15, Vagrant Cascadian wrote: > Please consider a guix lint description/synopsis check for basic > spelling, typo and rudimentary grammar issues. ... > Many of these are likely to be caught by most spell checking routines; > I'm not sure if there is anything that would be implementable in pure > guile, or it if would make sense to call out to an external > spellchecker. > > Some of them might be harder, and obviously we do not want too many > false positives, but no need to get perfectionist on solving this; even > just checking for "This packages" would haved detected many of these > issues! In the attached patch, I've implemented a simple lint check for "This packages", which has been fixed in ... 42 packages so far in the git repository, so maybe this could help catch future ones! I haven't implemented a more complicated spellchecker or grammar checker or anything, but at least this is a start. I think it is also within my skills to address "allows to" and "permits to", if I'm not heading down the wrong path here... live well, vagrant --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-lint-Add-description-check-for-check-pluralized-pack.patch Content-Transfer-Encoding: quoted-printable From=20d4b851f5722cd6f8d514a4254884d1f7a016b74f Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 21 Apr 2021 09:26:45 -0700 Subject: [PATCH] lint: Add description check for check-pluralized-package Fixes: https://issues.guix.gnu.org/44675 * guix/lint.scm: Check for occurances of "This packages" in package descriptions. * tests/lint.scm: Add test. =2D-- guix/lint.scm | 9 +++++++++ tests/lint.scm | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/guix/lint.scm b/guix/lint.scm index 1bebfe03d3..ffeac18077 100644 =2D-- a/guix/lint.scm +++ b/guix/lint.scm @@ -221,6 +221,14 @@ 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-pluralized-this-package description) + "Check that DESCRIPTION does not contain This packages" + (if (string-match "This packages" description) + (list + (make-warning package + (G_ "description contains This Packages but should just be This p= ackage"))) + '())) + (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." @@ -283,6 +291,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") (check-not-empty description) (check-quotes description) (check-trademarks description) + (check-pluralized-this-package description) ;; 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 a2c8665142..6cb7a98686 100644 =2D-- a/tests/lint.scm +++ b/tests/lint.scm @@ -160,6 +160,13 @@ (description "This is a 'quoted' thing.")))) (check-description-style pkg)))) =20 +(test-equal "description: pluralized this package" + "description contains This Packages but should just 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/If5cWqgUCYICw8AAKCRDcUY/If5cW ql31AQDhw/mVDLHlM7VAiztoP8oGG+hY2Zkmksac+kaAFKTEiQD9Gmi+llqfzsUz 2rP03GAKD8s9BKyuMDu9havpzQXHpAo= =M7KV -----END PGP SIGNATURE----- --==-=-=--