From: "Ludovic Courtès" <ludo@gnu.org>
To: Xinglu Chen <public@yoctocell.xyz>
Cc: 47804-done@debbugs.gnu.org, Maxime Devos <maximedevos@telenet.be>
Subject: bug#47804: [PATCH] lint: Warn about underscores in package names.
Date: Fri, 16 Apr 2021 22:54:47 +0200 [thread overview]
Message-ID: <87eefa2bmw.fsf_-_@gnu.org> (raw)
In-Reply-To: <94d0b8cb2322ed634442c0ebb79589e5dc05e526.1618511382.git.public@yoctocell.xyz> (Xinglu Chen's message of "Thu, 15 Apr 2021 20:31:44 +0200")
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
Hi,
Xinglu Chen <public@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’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 464 bytes --]
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")
next prev parent reply other threads:[~2021-04-16 20:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 16:00 [bug#47804] [PATCH] lint: Warn about underscores in package names Xinglu Chen
2021-04-15 16:19 ` Maxime Devos
2021-04-15 18:15 ` Xinglu Chen
2021-04-16 10:19 ` Maxime Devos
2021-04-15 18:31 ` [bug#47804] [PATCH v2] " Xinglu Chen
2021-04-16 20:54 ` Ludovic Courtès [this message]
2021-04-16 21:42 ` [bug#47804] [PATCH] " Julien Lepiller
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eefa2bmw.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=47804-done@debbugs.gnu.org \
--cc=maximedevos@telenet.be \
--cc=public@yoctocell.xyz \
/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 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).