From: Vagrant Cascadian <vagrant@debian.org>
To: 44675@debbugs.gnu.org
Subject: bug#44675: guix lint: support for spellchecker or basic grammar
Date: Wed, 21 Apr 2021 16:10:40 -0700 [thread overview]
Message-ID: <87tunznsi7.fsf@yucca> (raw)
In-Reply-To: <87ima6rrri.fsf@yucca>
[-- Attachment #1.1: Type: text/plain, Size: 1100 bytes --]
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
[-- Attachment #1.2: 0001-lint-Add-description-check-for-check-pluralized-pack.patch --]
[-- Type: text/x-diff, Size: 2453 bytes --]
From d4b851f5722cd6f8d514a4254884d1f7a016b74f 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 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.
---
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
--- 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..6cb7a98686 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 --]
next prev parent reply other threads:[~2021-04-21 23:11 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 [this message]
2021-04-22 16:42 ` Maxime Devos
2021-04-22 17:57 ` Vagrant Cascadian
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tunznsi7.fsf@yucca \
--to=vagrant@debian.org \
--cc=44675@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.