lint: Warn about underscores in package names.

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.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Xinglu Chen 2021-04-15 20:31:44 +02:00 committed by Ludovic Courtès
parent 5b35c9adc8
commit c68070e4ee
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 23 additions and 8 deletions

View file

@ -8,6 +8,7 @@
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
@ -270,6 +271,12 @@
(description "Imagine this is Taylor UUCP."))))
(check-synopsis-style pkg)))
(test-equal "name: use underscore in package name"
"name should use hyphens instead of underscores"
(single-lint-warning-message
(let ((pkg (dummy-package "under_score")))
(check-name pkg))))
(test-equal "inputs: pkg-config is probably a native input"
"'pkg-config' should probably be a native input"
(single-lint-warning-message