aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGabriel Wicki <gabriel@erlikon.ch>2024-12-02 23:35:09 +0100
committerLudovic Courtès <ludo@gnu.org>2024-12-12 12:52:07 +0100
commit00879f94eeadb63f17278ff2f5acb666f6879d22 (patch)
tree14cb46a4621e908d60b4530f9f3e7cdd7cf9a61e /tests
parentdac3011477b6524fb3af9bbcf36de10c3e92c713 (diff)
downloadguix-00879f94eeadb63f17278ff2f5acb666f6879d22.tar
guix-00879f94eeadb63f17278ff2f5acb666f6879d22.tar.gz
lint: Refine description start check logic.
Fix linter warnings for the following: - packages that belong to some programming language or ecosystem, e.g. python-foo or texlive-bar, - packages whose names end in a version distinction, e.g. wlroots-0.16 and - packages where the software's real name contains an underscore `_' character where our package name replaced that with a hyphen `-', e.g. wpa_supplicant and wpa-supplicant-minimal. * guix/lint.scm (check-description-style)[check-proper-start]: Add conditions. * tests/lint.scm: New tests. Change-Id: Ifc9f5cda04db59e460e287cd93afae89c7f17e3c Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/lint.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index b899ebc700..9297bfbaac 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021, 2023 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2024 Gabriel Wicki <gabriel@erlikon.ch>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -132,6 +133,30 @@
(description "x is a dummy package."))))
(check-description-style pkg)))
+(test-equal "description: may start with beginning of package name"
+ '()
+ (let ((pkg (dummy-package "xyz-0.1"
+ (description "xyz is a dummy package."))))
+ (check-description-style pkg)))
+
+(test-equal "description: may start with end of package name"
+ '()
+ (let ((pkg (dummy-package "foobar-xyz"
+ (description "xyz is a dummy package."))))
+ (check-description-style pkg)))
+
+(test-equal "description: may start with non-hyphenated package name"
+ '()
+ (let ((pkg (dummy-package "foobar-xyz-minimal"
+ (description "foobar_xyz is a dummy package."))))
+ (check-description-style pkg)))
+
+(test-equal "description: may start with end of package name"
+ '()
+ (let ((pkg (dummy-package "foo-bar"
+ (description "bar is some thing in foo."))))
+ (check-description-style pkg)))
+
(test-equal "description: two spaces after end of sentence"
"sentences in description should be followed by two spaces; possible infraction at 3"
(single-lint-warning-message