From 88e44f7e1615579cee27a08bcde31248e65c1178 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Fri, 4 Mar 2022 13:00:56 +0000 Subject: lint: check-tests-true: Allow #:tests? #t for some build systems. emacs-build-system sets #:tests? #f by default, so the linter shouldn't warn if #:tests? #t is set for packages using emacs-build-system. Likewise for texlive-build-system. * guix/lint.scm (check-tests-true): Do not warn if the build system is emacs-build-system or texlive-build-system. * tests/lint.scm ("tests-true: #:tests? #t acceptable for emacs packages") ("tests-true: #:tests? #t acceptable for texlive packages"): New tests. Fixes: Reported-by: Maxim Cournoyer Signed-off-by: Maxim Cournoyer --- guix/lint.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'guix/lint.scm') diff --git a/guix/lint.scm b/guix/lint.scm index 3ca7a0b608..e535eb8158 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -34,6 +34,7 @@ #:use-module (guix store) #:autoload (guix base16) (bytevector->base16-string) #:use-module (guix base32) + #:use-module (guix build-system) #:use-module (guix diagnostics) #:use-module (guix download) #:use-module (guix ftp-client) @@ -279,6 +280,16 @@ superfluous when building natively and incorrect when cross-compiling." (eq? tests? #t)) (package-arguments package))) (if (and (tests-explicitly-enabled?) + ;; emacs-build-system sets #:tests? #f by default, therefore + ;; writing #:tests? #t in package definitions using + ;; emacs-build-system is reasonable. Likewise for + ;; texlive-build-system. + ;; + ;; Compare the name of the build system instead of the build system + ;; itself to avoid loading unnecessary modules when only a few + ;; modules are linted. + (not (memq (build-system-name (package-build-system package)) + '(emacs texlive))) ;; Some packages, e.g. gnutls, set #:tests? ;; differently depending on whether it is being ;; cross-compiled. -- cgit v1.2.3