diff mbox series

[bug#70715,4/4] guix: End package descriptions with period.

Message ID 20240502125900.15177-4-herman@rimm.ee
State New
Headers show
Series Change imported crate style. | expand

Commit Message

Herman Rimm May 2, 2024, 12:59 p.m. UTC
* guix/import/utils.scm (beautify-description): Append period to last
words which do not end with one.

Change-Id: Ia901dccadee6b4fef6c7f0176ce5871409ff6ce6
---
 guix/import/utils.scm | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 09a01cf315..e06f06e196 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -370,6 +370,13 @@  (define* (beautify-description description #:optional (length 80))
              (cons* "This" "package"
                     (string-downcase first) rest))
             (_ words)))
+         (new-words
+           (match new-words
+             ((rest ... last)
+              (reverse (cons (if (string-suffix? "." last)
+                               last
+                               (string-append last "."))
+                             (reverse rest))))))
          (cleaned
           (string-join (map fix-word new-words))))
     ;; Use double spacing between sentences