From eef01cfe8eac8dee8ecf727e4ca459ae065e15ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 28 Nov 2017 15:05:55 +0100 Subject: lint: 'patch-file-names' checks for file name length. Reported at by Danny Milosavljevic . * guix/scripts/lint.scm (%distro-directory): New variable. (check-patch-file-names): Add check for the file name length. * tests/lint.scm ("patches: file name too long"): New test. --- tests/lint.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/lint.scm') diff --git a/tests/lint.scm b/tests/lint.scm index 1d0fc4708c..064f3d177e 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013 Cyril Roelandt ;;; Copyright © 2014, 2015, 2016 Eric Bavier -;;; Copyright © 2014, 2015, 2016 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; Copyright © 2016 Hartmut Goebel ;;; Copyright © 2017 Alex Kost @@ -331,6 +331,19 @@ (check-patch-file-names pkg))) "file names of patches should start with the package name"))) +(test-assert "patches: file name too long" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (source + (dummy-origin + (patches (list (string-append "x-" + (make-string 100 #\a) + ".patch")))))))) + (check-patch-file-names pkg))) + "file name is too long"))) + (test-assert "patches: not found" (->bool (string-contains -- cgit v1.2.3