GNU bug report logs - #47028
Discourage single-character package names

Previous Next

Package: guix;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Tue, 9 Mar 2021 21:40:01 UTC

Severity: normal

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 47028 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: 47028 <at> debbugs.gnu.org
Subject: [PATCH 2/2] lint: Warn about single-character package names.
Date: Tue,  9 Mar 2021 22:41:58 +0100
* 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 <at> scratchpost.org>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost <at> gmail.com>
-;;; Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2017, 2021 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2017, 2018, 2020 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2020 Chris Marusich <cmmarusich <at> 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





This bug report was last modified 4 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.