From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AGC6CHn1cWHlRwAAgWs5BA (envelope-from ) for ; Fri, 22 Oct 2021 01:19:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GFVrBHn1cWGWGQAA1q6Kng (envelope-from ) for ; Thu, 21 Oct 2021 23:19:21 +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 266C484B5 for ; Fri, 22 Oct 2021 01:19:20 +0200 (CEST) Received: from localhost ([::1]:40878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdhLC-0003l2-HP for larch@yhetil.org; Thu, 21 Oct 2021 19:19:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdhKw-0003ks-AJ for bug-guix@gnu.org; Thu, 21 Oct 2021 19:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdhKw-0006TN-2F for bug-guix@gnu.org; Thu, 21 Oct 2021 19:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mdhKv-0003eE-UD for bug-guix@gnu.org; Thu, 21 Oct 2021 19:19:01 -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: Thu, 21 Oct 2021 23:19:01 +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.163485832713995 (code B ref 44675); Thu, 21 Oct 2021 23:19:01 +0000 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 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-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=1634858360; 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=P9wJlzMqZlByDar9cqUuof7ZtQjdntoikOxlmhuQ6bk=; b=In1ExOQVfyJFY2zAO6LOP2xqwM3hcF0gKzrIgKeXVzjNqYcGxh+5YoXqj93POZO+laQhv7 xEyc7hyQ6e044B1y3j3tLR6IVOEYcaSqB9VUDkfzqZ61LvbYMqHKOqpXeACtz5kNQtHR7j Eg7u1sIIacXP22PU2ifeiLXWwct3oVmCD52u1+G4R11d6fyYLKLjoQ8otxLN09j2NqqhxA Go4aHP+J8TDNmiqU35olDQ1BOdEyojzxuVcT9XuZg+utULWDlVfkpYhDulS1jl4nXrRXZN JSyQxV+IpTjpypHbqYadcoDMizMBIhRnYnLLjsCAeeG7+O2/1XqJBpndThvVww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634858360; a=rsa-sha256; cv=none; b=csOmWJdsdkn8+FXK/oanWOqEPiSNqtZbjyhAhcMKplJavt6HQmMYY5z2wJRByANEIvytcY ck6LdGnAij6Lj78RRLEnrBY5RZzVTkYq6y8WFganS5xGYYNhHF0cuJMX9G6TV5B5LpS9vT piYiR/RnMRdqt0dSl1WhAvck1jXpZ81RqJaaBUD5c68NGILzjGSuJV4QhxUH5ID6kjy8WV pCamgOJyBtEsgDkVnKBC26l2d+K8ffihKksec5bGy6p1mdNwnbo4D3ei1188wXI2E75csk Kza7kkCVVe29gajbt+7X53wGFkT0EgsZVXXW7AWnwTp8iBOoAL0t7rwiYBTRhQ== 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: -4.03 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: 266C484B5 X-Spam-Score: -4.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: iRSTnO3tpJr1 --==-=-= 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----- --==-=-=--