From: Tobias Geerinckx-Rice via Bug reports for GNU Guix <bug-guix@gnu.org>
To: 47028@debbugs.gnu.org
Subject: bug#47028: [PATCH 2/2] lint: Warn about single-character package names.
Date: Tue, 9 Mar 2021 22:41:58 +0100 [thread overview]
Message-ID: <20210309214158.31754-2-me@tobias.gr> (raw)
In-Reply-To: <20210309214158.31754-1-me@tobias.gr>
* guix/lint.scm (check-name): New procedure.
(%local-checkers): Add it.
---
guix/lint.scm | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/guix/lint.scm b/guix/lint.scm
index 311bc94cc3..5144fa139d 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -6,7 +6,7 @@
;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
@@ -170,6 +170,16 @@
(requires-store? lint-checker-requires-store?
(default #f)))
+(define (check-name package)
+ "Check whether PACKAGE's name matches our guidelines."
+ ;; Currently checks only whether the name is too short.
+ (if (<= (string-length (package-name package)) 1)
+ (list
+ (make-warning package
+ (G_ "name should be longer than a single character")
+ #:field 'name))
+ '()))
+
(define (properly-starts-sentence? s)
(string-match "^[(\"'`[:upper:][:digit:]]" s))
@@ -1445,6 +1455,10 @@ them for PACKAGE."
(define %local-checkers
(list
+ (lint-checker
+ (name 'name)
+ (description "Validate package names")
+ (check check-name))
(lint-checker
(name 'description)
(description "Validate package descriptions")
--
2.30.1
next prev parent reply other threads:[~2021-03-09 21:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 5:27 Opposition to new single-letter package name "t" Mark H Weaver
2021-03-09 5:39 ` Raghav Gururajan
2021-03-09 5:47 ` jgart
2021-03-09 6:08 ` Raghav Gururajan
2021-03-09 9:35 ` Leo Prikler
2021-03-09 11:38 ` Tobias Geerinckx-Rice
2021-03-09 11:40 ` Julien Lepiller
2021-03-09 13:09 ` Ricardo Wurmus
2021-03-09 12:40 ` Raghav Gururajan
2021-03-09 18:12 ` Nicolas Goaziou
2021-03-10 0:16 ` Mark H Weaver
2021-03-09 13:32 ` Search improvements (Was: Opposition to new single-letter package name "t") Taylan Kammer
2021-03-09 15:12 ` zimoun
2021-03-09 16:18 ` Tobias Geerinckx-Rice
2021-03-09 18:37 ` zimoun
2021-03-09 21:39 ` bug#47028: Discourage single-character package names Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-03-09 21:41 ` bug#47028: [PATCH 1/2] doc: Discourage ambiguous " Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-03-09 21:41 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix [this message]
2021-03-26 8:26 ` bug#47028: [PATCH 2/2] lint: Warn about single-character " zimoun
2021-04-01 8:51 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-04-01 20:41 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-03-09 21:51 ` bug#47028: [PATCH 1/2] doc: Discourage ambiguous " Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-03-10 0:44 ` bug#47028: Discourage single-character " Mark H Weaver
2021-03-10 11:28 ` Ludovic Courtès
2021-03-10 13:04 ` zimoun
2021-04-01 8:57 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210309214158.31754-2-me@tobias.gr \
--to=bug-guix@gnu.org \
--cc=47028@debbugs.gnu.org \
--cc=me@tobias.gr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.