diff options
author | Herman Rimm <herman@rimm.ee> | 2024-05-12 21:08:32 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-06-03 22:58:53 +0200 |
commit | 510ad5d93c0ba6208aa42815863853ec522352e6 (patch) | |
tree | af09e40150c1763cfbc0387de5090264fa5bf1bb /guix | |
parent | e62fd9004bf0e4a9b32f7ce3c1192aa067349b83 (diff) |
import: utils: End package descriptions with period.
* guix/import/utils.scm (beautify-description): Append period to last
words which do not end with one.
* tests/crate.scm: Append period to descriptions.
* tests/elm.scm: Append period to descriptions.
* tests/gem.scm: Append period to descriptions.
* tests/hexpm.scm: Append period to descriptions.
* tests/minetest.scm: Append period to descriptions.
* tests/pypi.scm: Append period to descriptions.
* tests/import-utils.scm ("beautify-description: transform fragment into
sentence"): Likewise.
Change-Id: I0b12c4d94cb26cf62fab5b7cbf7885e66ff6c10f
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix')
-rw-r--r-- | guix/import/utils.scm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 09a01cf315..45fed93134 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -370,6 +370,15 @@ LENGTH characters." (cons* "This" "package" (string-downcase first) rest)) (_ words))) + (new-words + (match new-words + ((rest ... last) + (reverse (cons (if (or (string-suffix? "." last) + (string-suffix? "!" last) + (string-suffix? "?" last)) + last + (string-append last ".")) + (reverse rest)))))) (cleaned (string-join (map fix-word new-words)))) ;; Use double spacing between sentences |