From c68070e4eefd25118b368bd7af872f65ab739fc7 Mon Sep 17 00:00:00 2001 From: Xinglu Chen Date: Thu, 15 Apr 2021 20:31:44 +0200 Subject: lint: Warn about underscores in package names. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/lint.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/lint.scm') diff --git a/tests/lint.scm b/tests/lint.scm index bd8604f589..a2c8665142 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2018, 2019 Arun Isaac ;;; Copyright © 2020 Timothy Sample +;;; Copyright © 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -270,6 +271,12 @@ (define (warning-contains? str warnings) (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 -- cgit v1.2.3