~ruther/guix-local

7752580a33f416119d5ee2e9c553c8578a8ca23f — jgart 6 months ago e49aa0f
guix: lint: Check end of sentences for a period.

* guix/lint.scm (check-description-style): Check that sentences end with a period.

Change-Id: Ic10161f8093351dce440e19802a71f03bc849638
Signed-off-by: jgart <jgart@dismail.de>
2 files changed, 17 insertions(+), 0 deletions(-)

M guix/lint.scm
M tests/lint.scm
M guix/lint.scm => guix/lint.scm +10 -0
@@ 396,6 396,15 @@ superfluous when building natively and incorrect when cross-compiling."
                       #:field 'description))
        '()))

  (define (check-ends-with-period description)
    "Checks that a description field ends with a period."
    (if (not (string-suffix? "." description))
        (list
         (make-warning package
                       (G_ "description should end with a period")
                       #:field 'description))
        '()))

  (define (check-texinfo-markup description)
    "Check that DESCRIPTION can be parsed as a Texinfo fragment.  If the
markup is valid return a plain-text version of DESCRIPTION, otherwise #f."


@@ 515,6 524,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
         (check-not-empty description)
         (check-quotes description)
         (check-trademarks description)
         (check-ends-with-period description)
         (check-description-typo description
          '(("Infrastucture" . "Infrastructure")    ; codespell:ignore
            ("This packages" . "This package")      ; codespell:ignore

M tests/lint.scm => tests/lint.scm +7 -0
@@ 108,6 108,13 @@
   (check-description-style
    (dummy-package "x" (description "")))))

(test-equal "description: does not end with a period"
  "description should end with a period"
  (single-lint-warning-message
   (let ((pkg (dummy-package "x"
                             (description "This package provides a bad description"))))
     (check-description-style pkg))))

(test-equal "description: invalid Texinfo markup"
  "Texinfo markup in description is invalid"
  (single-lint-warning-message