unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47028: Discourage single-character package names
       [not found] <87h7lkj3pt.fsf@netris.org>
@ 2021-03-09 21:39 ` 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
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-03-09 21:39 UTC (permalink / raw)
  To: 47028; +Cc: Mark H Weaver

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

Mark H Weaver 写道:
> Yesterday, an obscure package called "t" was added to Guix.  We 
> should
> reject such short package names in Guix unless there's a very 
> compelling
> reason to keep them.

I completely agree (in fact I can't compel myself to find 
excusable exceptions), but this wasn't explicitly documented 
anywhere I looked.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: [PATCH 1/2] doc: Discourage ambiguous package names.
  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   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2021-03-09 21:41     ` bug#47028: [PATCH 2/2] lint: Warn about single-character " 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-04-01  8:57   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2 siblings, 2 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-03-09 21:41 UTC (permalink / raw)
  To: 47028

* doc/contributing.texi (Package Naming): Explicitly mention
single-character and otherwise ambiguous names.
---
 doc/contributing.texi | 8 ++++++++
 doc/guix.texi         | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/contributing.texi b/doc/contributing.texi
index c9dd7d6c04..a3facdcadc 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -445,6 +445,14 @@ the project name chosen upstream, with underscores replaced with
 hyphens.  For instance, GNUnet is available as @code{gnunet}, and
 SDL_net as @code{sdl-net}.
 
+A noteworthy exception to this rule is when the project name is only a
+single character, or if an older maintained project with the same name
+already exists---regardless of whether it has already been packaged for
+Guix.  Use common sense to make such names unambiguous and meaningful.
+For example, Guix's package for the shell called ``s'' upstream is
+@code{s-shell} and @emp{not} @code{s}.  Feel free to ask your fellow
+hackers for inspiration.
+
 We do not add @code{lib} prefixes for library packages, unless these are
 already part of the official project name.  But @pxref{Python
 Modules} and @ref{Perl Modules} for special rules concerning modules for
diff --git a/doc/guix.texi b/doc/guix.texi
index f01e7ca89d..d726fa491f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -49,7 +49,7 @@ Copyright @copyright{} 2017, 2021 Christopher Lemmer Webber@*
 Copyright @copyright{} 2017, 2018, 2019, 2020 Marius Bakke@*
 Copyright @copyright{} 2017, 2019, 2020 Hartmut Goebel@*
 Copyright @copyright{} 2017, 2019, 2020, 2021 Maxim Cournoyer@*
-Copyright @copyright{} 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice@*
+Copyright @copyright{} 2017, 2018, 2019, 2020, 2021 Tobias Geerinckx-Rice@*
 Copyright @copyright{} 2017 George Clemmer@*
 Copyright @copyright{} 2017 Andy Wingo@*
 Copyright @copyright{} 2017, 2018, 2019, 2020 Arun Isaac@*
-- 
2.30.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#47028: [PATCH 2/2] lint: Warn about single-character package names.
  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
  2021-03-26  8:26       ` zimoun
  2021-03-09 21:51     ` bug#47028: [PATCH 1/2] doc: Discourage ambiguous " Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 1 reply; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-03-09 21:41 UTC (permalink / raw)
  To: 47028

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#47028: [PATCH 1/2] doc: Discourage ambiguous package names.
  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     ` bug#47028: [PATCH 2/2] lint: Warn about single-character " Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2021-03-09 21:51     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 0 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-03-09 21:51 UTC (permalink / raw)
  Cc: 47028

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

Tobias Geerinckx-Rice via Bug reports for GNU Guix 写道:
> +@code{s-shell} and @emp{not} @code{s}.  Feel free to ask your 
> fellow
                       ???

I'm sorry, I'm really useless today.  This should of course be 
correct & not wrong.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: Discourage single-character package names
  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-10  0:44   ` 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
  2 siblings, 2 replies; 11+ messages in thread
From: Mark H Weaver @ 2021-03-10  0:44 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 47028

Hi Tobias,

Tobias Geerinckx-Rice <me@tobias.gr> writes:

> Mark H Weaver 写道:
>> Yesterday, an obscure package called "t" was added to Guix.  We
>> should reject such short package names in Guix unless there's a very
>> compelling reason to keep them.
>
> I completely agree (in fact I can't compel myself to find 
> excusable exceptions), but this wasn't explicitly documented 
> anywhere I looked.

We have one notable exception in Guix: "r", which is "grandfathered in"
so-to-speak, but perhaps it would have been excusable anyway, given its
prominence and its large number of related packages "r-*".

I fully support your proposal to talk about single-character names in
the manual, and also to check for them in the linter, but perhaps "r"
should be whitelisted.

    Thank you!
       Mark




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: Discourage single-character package names
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2021-03-10 11:28 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 47028

Hi Mark & Tobias,

Mark H Weaver <mhw@netris.org> skribis:

> I fully support your proposal to talk about single-character names in
> the manual, and also to check for them in the linter, but perhaps "r"
> should be whitelisted.

Seconded on both points!  The patches look great to me.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: Discourage single-character package names
  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
  1 sibling, 0 replies; 11+ messages in thread
From: zimoun @ 2021-03-10 13:04 UTC (permalink / raw)
  To: Mark H Weaver, Tobias Geerinckx-Rice; +Cc: Ricardo Wurmus, 47028

Hi,

(CC: Ricardo since they is the master about R stuff. :-))


On Tue, 09 Mar 2021 at 19:44, Mark H Weaver <mhw@netris.org> wrote:

> We have one notable exception in Guix: "r", which is "grandfathered in"
> so-to-speak, but perhaps it would have been excusable anyway, given its
> prominence and its large number of related packages "r-*".
>
> I fully support your proposal to talk about single-character names in
> the manual, and also to check for them in the linter, but perhaps "r"
> should be whitelisted.

On the other hand, instead of simply the one letter “r”, we could rename
it “r-environment”.  Because the package currently named “r” is the
interpreter named “r-minimal” plus extra packages, constituting the
basic bricks of the “R environment” [1].

1: <https://www.r-project.org/about.html>

--8<---------------cut here---------------start------------->8---
(define-public r
  (package (inherit r-minimal)
    (name "r")
    (source #f)
    (build-system trivial-build-system)
    (arguments '(#:builder (begin (mkdir %output) #t)))
    (propagated-inputs
     `(("r-minimal" ,r-minimal)
       ("r-boot" ,r-boot)
       ("r-class" ,r-class)
       ("r-cluster" ,r-cluster)
       ("r-codetools" ,r-codetools)
       ("r-foreign" ,r-foreign)
       ("r-kernsmooth" ,r-kernsmooth)
       ("r-lattice" ,r-lattice)
       ("r-mass" ,r-mass)
       ("r-matrix" ,r-matrix)
       ("r-mgcv" ,r-mgcv)
       ("r-nlme" ,r-nlme)
       ("r-nnet" ,r-nnet)
       ("r-rpart" ,r-rpart)
       ("r-spatial" ,r-spatial)
       ("r-survival" ,r-survival)))))
--8<---------------cut here---------------end--------------->8---


I also support the proposal.  My point is: I am not even sure that “r”
should be whitelisted.


Cheers,
simon




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: [PATCH 2/2] lint: Warn about single-character package names.
  2021-03-09 21:41     ` bug#47028: [PATCH 2/2] lint: Warn about single-character " Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2021-03-26  8:26       ` 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
  0 siblings, 2 replies; 11+ messages in thread
From: zimoun @ 2021-03-26  8:26 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 47028

Hi,

On Tue, 09 Mar 2021 at 22:41, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> +(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)

Maybe the length can be negative or zero. ;-)


Well, both patches are LGTM.


Cheers,
simon




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: [PATCH 2/2] lint: Warn about single-character package names.
  2021-03-26  8:26       ` 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
  1 sibling, 0 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-04-01  8:51 UTC (permalink / raw)
  To: zimoun; +Cc: 47028

zimoun writes:
> Maybe the length can be negative or zero. ;-)

‘Defensive programming’!

Thanks, :-)

T G-R




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: Discourage single-character package names
  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-10  0:44   ` bug#47028: Discourage single-character " Mark H Weaver
@ 2021-04-01  8:57   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2 siblings, 0 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-04-01  8:57 UTC (permalink / raw)
  To: Mark H Weaver, 47028

[Inexcusably breaking thread because I lost the original.]

Mark,

> We have one notable exception in Guix: "r", which is 
> "grandfathered
> in" so-to-speak [...]

Very good point.  So grandfathered it didn't occur to me.

> [...] perhaps "r"should be whitelisted.

I agree.  Thanks for pointing it out!

T G-R




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#47028: [PATCH 2/2] lint: Warn about single-character package names.
  2021-03-26  8:26       ` 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
  1 sibling, 0 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-04-01 20:41 UTC (permalink / raw)
  To: zimoun; +Cc: 47028-done

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

zimoun writes:
> My point is: I am not even sure that “r” should be whitelisted.

I think it deserves the name, but my reasons are fuzzy and feely. 
Anyway: I added that exception for ‘r’ and pushed as 
1126bb9cf33f10f004a5f53331389c777c025e75 et al.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-01 20:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87h7lkj3pt.fsf@netris.org>
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     ` bug#47028: [PATCH 2/2] lint: Warn about single-character " Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-03-26  8:26       ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).