GNU bug report logs -
#44675
guix lint: support for spellchecker or basic grammar
Previous Next
Reported by: Vagrant Cascadian <vagrant <at> debian.org>
Date: Mon, 16 Nov 2020 01:55:01 UTC
Severity: normal
Tags: easy
Done: Vagrant Cascadian <vagrant <at> debian.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Vagrant,
On Thu, 21 Oct 2021 at 16:18, Vagrant Cascadian <vagrant <at> 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
This bug report was last modified 3 years and 292 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.