unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: Maxime Devos <maximedevos@telenet.be>, 44675@debbugs.gnu.org
Subject: bug#44675: guix lint: support for spellchecker or basic grammar
Date: Thu, 22 Apr 2021 10:57:56 -0700	[thread overview]
Message-ID: <87o8e6nqvv.fsf@yucca> (raw)
In-Reply-To: <2f3077c0d040e4b40db19d98195845e124b064d3.camel@telenet.be>


[-- Attachment #1.1: Type: text/plain, Size: 1358 bytes --]

On 2021-04-22, Maxime Devos wrote:
> +  (define (check-pluralized-this-package description)
> +    "Check that DESCRIPTION does not contain This packages"
>
> The sentence structure would be clearer if you used quotes here,
> something like "Check that DESCRIPTION does not contain ‘This packages’".

Any compelling reason to use ‘This packages’ vs. 'This packages' ? It
seems other quotes in guix/lint.scm use '' also, and I'm not apparently
skilled enough with a keyboard to generate ‘’-style quotes... :)


> +    (if (string-match "This packages" description)
> +	(list
> +	 (make-warning package
> +		       (G_ "description contains This Packages but should just be This package")))
>
> There are no package descriptions containing "This Packages".
> Did you mean "This packages"?

Nice catch, thanks!


>> +(test-equal "description: pluralized this package"
> Quotes: "description: pluralized ‘this package’".

Noted.


>> +  "description contains This Packages but should just be This package"
> Capitalisation error: This Packages --> This packages
> Also, quotes: "description contains ‘This packages’ but should just be ‘This package’".

Again, nice catch!


Updated the commit message and incorporated the above suggestions into
the updated attached patch.


live well,
  vagrant

[-- Attachment #1.2: 0001-lint-Add-description-check-for-pluralized-This-packa.patch --]
[-- Type: text/x-diff, Size: 2512 bytes --]

From 4e724fbe9815e1c27967b835f08d2259164538ba Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Wed, 21 Apr 2021 09:26:45 -0700
Subject: [PATCH] lint: Add description check for pluralized "This package"

Partial fix for: https://issues.guix.gnu.org/44675

* guix/lint.scm (check-pluralized-this-package): Add check for
  occurances of "This packages" in package descriptions.
* tests/lint.scm: Add test.
---
 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..e00048349b 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -221,6 +221,14 @@ markup is valid return a plain-text version of DESCRIPTION, otherwise #f."
                       (G_ "Texinfo markup in description is invalid")
                       #:field 'description))))
 
+  (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 package'")))
+	'()))
+
   (define (check-trademarks description)
     "Check that DESCRIPTION does not contain '™' or '®' characters.  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..3e1b95680a 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -160,6 +160,13 @@
                              (description "This is a 'quoted' thing."))))
      (check-description-style pkg))))
 
+(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
-- 
2.30.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2021-04-22 18:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16  1:53 bug#44675: guix lint: support for spellchecker or basic grammar Vagrant Cascadian
2020-11-16  5:55 ` zimoun
2021-04-21 23:10 ` Vagrant Cascadian
2021-04-22 16:42   ` Maxime Devos
2021-04-22 17:57     ` Vagrant Cascadian [this message]
2021-04-22 18:05       ` Maxime Devos
2021-05-04 16:40       ` Ludovic Courtès
2021-06-09 15:33         ` Vagrant Cascadian
2021-10-21 23:18           ` Vagrant Cascadian
2021-10-22  8:33             ` zimoun
2021-10-24 11:22               ` Vagrant Cascadian
2021-10-24 11:56                 ` zimoun
2021-10-24 19:02                   ` Vagrant Cascadian
2021-10-24 21:41                     ` Vagrant Cascadian
2021-04-25  7:27   ` Efraim Flashner
2021-04-25 16:43     ` Vagrant Cascadian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8e6nqvv.fsf@yucca \
    --to=vagrant@debian.org \
    --cc=44675@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).