all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Vagrant Cascadian <vagrant@debian.org>, 44675@debbugs.gnu.org
Subject: bug#44675: guix lint: support for spellchecker or basic grammar
Date: Fri, 22 Oct 2021 10:33:27 +0200	[thread overview]
Message-ID: <865ytpzcfc.fsf@gmail.com> (raw)
In-Reply-To: <8735ouotkl.fsf@yucca>

Hi Vagrant,

On Thu, 21 Oct 2021 at 16:18, Vagrant Cascadian <vagrant@debian.org> wrote:

> 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...

If I remember correctly the previous discussion, Debian uses an external
tool for spellchecking.  Here, the patch uses a list of “common”
mistakes.  It is seems an easy good start. :-)


> +  (define (check-description-typo description typo correction)

Instead, I would use a list of alist ’typo-corrections’ as argument.
For instance,

--8<---------------cut here---------------start------------->8---
(define (check-description-typo description typo-corrections)
  (for-each
   (match-lambda
     ((typo . correction)
      (if (string-contains description typo)
          (list
           (make-warning ...))
          '())))
   typo-corrections))
--8<---------------cut here---------------end--------------->8---

> +    "Check that DESCRIPTION does not contain typo, with optional
> correction"
> +    (if (string-contains description typo)
> +        (list
> +	   (make-warning package
> +	     	       (G_
> +                        (format #false
> +                                "description contains typo '~a'~@[, should be '~a'~]"
> +		                typo correction))))
> +        '()))
> +

[...]

> +         (check-description-typo description "This packages" "This package")

And the call reads,

            (check-description-typo description '(("This packages" . "This package")))

which allows easily to add new pattern; such as,

        '(("This packages" . "This package")
          ("this packages" . "this package")
          ("This modules" . "This module"))

Then, as a second step, depending on the patterns listed, let see if
there is a pattern inside these patterns. ;-) (Check both capitalize and
lower-case, etc.)


Cheers,
simon




  reply	other threads:[~2021-10-22  8:39 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
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 [this message]
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=865ytpzcfc.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=44675@debbugs.gnu.org \
    --cc=vagrant@debian.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.