GNU bug report logs - #47804
[PATCH] lint: Warn about underscores in package names.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Thu, 15 Apr 2021 16:02:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 47804-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 47804-done <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#47804: [PATCH] lint: Warn about underscores in package names.
Date: Fri, 16 Apr 2021 22:54:47 +0200
[Message part 1 (text/plain, inline)]
Hi,

Xinglu Chen <public <at> yoctocell.xyz> skribis:

> As per section '16.4.2 Package Naming' in the manual, use hyphens
> instead of underscores in package names.
>
> * guix/lint.scm (check-name): Check whether the package name contains
> underscores.
> * tests/lint.scm ("name: use underscore in package name"): New test.

Applied with the minor change below, which avoids regexps
(‘string-match’ performs regexp matches, which is overkill here).

Thank you and thanks Maxime for the review!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/lint.scm b/guix/lint.scm
index 38699e2927..1bebfe03d3 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -183,7 +183,7 @@
        (make-warning package
                      (G_ "name should be longer than a single character")
                      #:field 'name)))
-     ((string-match "_" name)
+     ((string-index name #\_)
       (list
        (make-warning package
                      (G_ "name should use hyphens instead of underscores")

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

Previous Next


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