aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-lint.sh
blob: 97c2ea83fefcd6182b2b690080f97c29026184ef (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# GNU Guix --- Functional package management for GNU
# Copyright © 2014 Cyril Roelandt <tipecaml@gmail.com>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

#
# Test the `guix lint' command-line utility.
#

guix lint --version

# Choose a module directory not below any %LOAD-PATH component.  This is
# necessary when testing '-L' with a relative file name.
module_dir="$(mktemp -d)"

mkdir -p "$module_dir"
trap "rm -rf $module_dir" EXIT


cat > "$module_dir/foo.scm"<<EOF
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages base))

(define-public dummy
  (package (inherit hello)
    (name "dummy")
    (version "42")
    (synopsis "dummy package")
    (description "dummy package. Only used for testing purposes.")))
EOF

GUIX_PACKAGE_PATH="$module_dir"
export GUIX_PACKAGE_PATH

grep_warning ()
{
    res=`echo "$1" | grep -E -c "(synopsis|description) should"`
    echo $res
}

# Three issues with the dummy package:
# 1) the synopsis starts with the package name;
# 2) the synopsis starts with a lower-case letter;
# 3) the description has a single space following the end-of-sentence period.

out=`guix lint -c synopsis,description dummy 2>&1`
test `grep_warning "$out"` -eq 3

out=`guix lint -c synopsis dummy 2>&1`
test `grep_warning "$out"` -eq 2

out=`guix lint -c description dummy 2>&1`
test `grep_warning "$out"` -eq 1

out=`guix lint -c description,synopsis dummy 2>&1`
test `grep_warning "$out"` -eq 3

guix lint -c synopsis,invalid-checker dummy 2>&1 | \
   grep -q 'invalid-checker: invalid checker'

# Make sure specifying multiple packages works.
guix lint -c inputs-should-be-native dummy dummy@42 dummy


# Use --load-path instead.
unset GUIX_PACKAGE_PATH

out=`guix lint -L $module_dir -c synopsis,description dummy 2>&1`
test `grep_warning "$out"` -eq 3

# Make sure specifying multiple packages works.
guix lint -L $module_dir -c inputs-should-be-native dummy dummy@42 dummy

# Test '-L' with a relative file name.  'guix lint' will see "t-xyz/foo.scm"
# (instead of "foo.scm") and will thus fail to find it in %LOAD-PATH.  Check
# that it does find it anyway.  See <https://bugs.gnu.org/42543>.
(cd "$module_dir"/.. ; guix lint -c formatting -L "$(basename "$module_dir")" dummy@42) 2>&1 > "$module_dir/out"
test -z "$(cat "$module_dir/out")"

# Likewise, when there's a warning, 'package-field-location' used to crash
# because it can't find "t-xyz/foo.scm".  See <https://bugs.gnu.org/46390>.
(cd "$module_dir"/.. ; guix lint -c synopsis -L "$(basename "$module_dir")" dummy@42) 2>&1 > "$module_dir/out"
grep_warning "`cat "$module_dir/out"`"
o.wigust@gmail.com> Pierre Langlois 2018-11-30gnu: sbcl-cl-webkit: Update repo owner to jmercouris....* gnu/packages/lisp.scm (sbcl-cl-webkit): Update repo owner to jmercouris. Pierre Neidhardt 2018-11-29gnu: sbcl: bootstrap with clisp on non-Intel machines....* gnu/packages/lisp.scm (sbcl)[native-inputs]: If the current system is not x86_64-linux or i686-linux, use clisp in place of ccl. [arguments]: In the custom build phase, use the correct bootstrap lisp. Efraim Flashner 2018-11-25gnu: Add s-xml-rpc....* gnu/packages/lisp.scm (cl-s-xml-rpc, ecl-s-xml-rpc, sbcl-s-xml-rpc): New variables. Pierre Neidhardt 2018-11-25gnu: Add s-xml....* gnu/packages/lisp.scm (cl-s-xml, ecl-s-xml, sbcl-s-xml): New variables. Pierre Neidhardt 2018-11-25gnu: Add usocket....* gnu/packages/lisp.scm (cl-usocket, ecl-usocket, sbcl-usocket): New variables. Pierre Neidhardt 2018-11-25gnu: Add usocket-server....* gnu/packages/lisp.scm (cl-usocket-server, ecl-usocket-server, sbcl-usocket-server): New variables. Pierre Neidhardt 2018-11-25gnu: Add sbcl-usocket-boot0....* gnu/packages/lisp.scm (sbcl-usocket-boot0): New variable. Pierre Neidhardt 2018-11-25gnu: Add portable-threads....* gnu/packages/lisp.scm (cl-portable-threads, ecl-portable-threads, sbcl-portable-threads): New variables. Pierre Neidhardt 2018-11-25gnu: Add cl-css....* gnu/packages/lisp.scm (cl-css, ecl-cl-css, sbcl-cl-css): New variables. Pierre Neidhardt 2018-11-25gnu: Add cl-markup....* gnu/packages/lisp.scm (cl-markup, ecl-cl-markup, sbcl-cl-markup): New variables. Pierre Neidhardt 2018-11-24gnu: sbcl: Update to 1.4.13....* gnu/packages/lisp.scm (sbcl): Update to 1.4.13. [native-inputs]: Use minimal texlive-union instead of full texlive. [native-inputs]: Use CCL instead of buggy CLISP. [arguments]: Replace all (zero? (system* ...)) by invoke. Pierre Neidhardt 2018-11-24gnu: gcl: Remove unnecessary texlive input....* gnu/packages/lisp.scm (gcl)[native-inputs]: Remove texlive. Pierre Neidhardt 2018-11-24gnu: clojure: Move to new clojure.scm....* gnu/local.mk (clojure): Include new clojure.scm. * gnu/packages/clojure.scm: Add clojure, clojure-algo-generic, clojure-algo-monads, clojure-core-match, clojure-instaparse, clojure-tools-macro. * gnu/packages/lisp.scm: Remove clojure, clojure-algo-generic, clojure-algo-monads, clojure-core-match, clojure-instaparse, clojure-tools-macro. Pierre Neidhardt 2018-11-24gnu: femtolisp: Move to scheme.scm....* gnu/packages/lisp.scm (femtolisp): Remove. * gnu/packages/scheme.scm (femtolisp): Add. Pierre Neidhardt 2018-11-22gnu: ccl: Fix missing command line argument support in wrapper....* gnu/packages/lisp.scm (ccl): Fix missing command line argument support in wrapper. Pierre Neidhardt 2018-11-22gnu: ccl: Properly include x86-headers and remove missing "contrib" folder....* gnu/packages/lisp.scm (ccl): Include x86-headers and remove missing "contrib" folder. [home-page]: Use HTTPS. Pierre Neidhardt 2018-11-20Revert "gnu: ccl: Include x86-headers and remove missing "contrib" folder."...This reverts commit d22ba64276c0bbacb77d0670635f67f053a16c6b, which broke evaluations for armhf-linux. Ludovic Courtès 2018-11-19gnu: Add clojure-algo-monads....* gnu/packages/lisp.scm (clojure-algo-monads): New public variable. Alex Vong 2018-11-19gnu: Add clojure-tools-macro....* gnu/packages/lisp.scm (clojure-tools-macro): New public variable. Alex Vong 2018-11-19gnu: Add clojure-algo-generic....* gnu/packages/lisp.scm (clojure-algo-generic): New public variable. Alex Vong 2018-11-19gnu: Add clojure-core-match....* gnu/packages/lisp.scm (clojure-core-match): New public variable. Alex Vong 2018-11-19gnu: Add clojure-instaparse....* gnu/packages/lisp.scm (clojure-instaparse): New public variable. Alex Vong 2018-11-19guix: Add clojure-utils....* guix/build/clojure-utils.scm: New file. * gnu/packages/lisp.scm (clojure)[arguments]: Use it. * Makefile.am (MODULES): Add it. Alex Vong 2018-11-19gnu: clojure: Use (guix build java-utils) to simplify build phases....* gnu/packages/lisp.scm (clojure)[arguments]: Use 'ant-build-javadoc', 'install-jars' and 'install-javadoc' in build phases. Alex Vong 2018-11-19gnu: clojure: Refactor to ensure there's a single list of libraries....This avoids having to update multiple lists. * gnu/packages/lisp.scm (clojure)[native-inputs]: Use new local variable. [arguments]: Adjust build phases accordingly. Alex Vong 2018-11-19gnu: clojure: Remove 'remove-archives' snippet....This is no longer needed since clojure now makes official source releases in github. * gnu/packages/lisp.scm (clojure)[source]: Remove it. [native-inputs]: Remove it in 'submodule'. [arguments]: Adjust 'unpack-submodule-sources' phase accordingly. Alex Vong 2018-11-19gnu: clojure: Move from java to lisp....* gnu/packages/java.scm (clojure): Move from here... * gnu/packages/lisp.scm (clojure): ...to here. Alex Vong 2018-11-18gnu: ccl: Include x86-headers and remove missing "contrib" folder....* gnu/packages/lisp.scm (ccl): Include x86-headers and remove missing "contrib" folder. Pierre Neidhardt 2018-11-03gnu: sbcl-lift: Don't keep the bundled website....* gnu/packages/lisp.scm (sbcl-lift)[source]: Remove bundled website. [arguments]: Remove custom 'make-gzips-writable phase. Efraim Flashner 2018-10-26gnu: sbcl-lift: Fix 'license' field....The invalid 'license' field was preventing evaluations from completing. * gnu/packages/lisp.scm (sbcl-lift)[license]: Change to LICENSE:EXPAT. Ludovic Courtès 2018-10-23gnu: sbcl-parse-float: Remove comment about license....* gnu/packages/lisp.scm (sbcl-parse-float): The license really is public domain. Pierre Neidhardt 2018-10-19gnu: sbcl-slime-swank: Remove reference to unbound variable....Fixes a regression introduced in commit c4d4ae1e16254a96caaeb5ccb4486f301ae4f1b7. * gnu/packages/lisp.scm (sbcl-slime-swank)[license]: Remove extra 'license'. Ludovic Courtès 2018-10-19gnu: Add lparallel....* gnu/packages/lisp.scm (cl-lparallel, ecl-lparallel, sbcl-lparallel): New variables. Pierre Neidhardt 2018-10-19gnu: Add sbcl-cl-webkit....* gnu/packages/lisp.scm (sbcl-cl-webkit): New variable. Pierre Neidhardt 2018-10-19gnu: Add sbcl-cl-cffi-gtk....* gnu/packages/lisp.scm (sbcl-cl-cffi-gtk): New variable. Pierre Neidhardt 2018-10-19gnu: Add sbcl-cl-cffi-gtk-gdk....* gnu/packages/lisp.scm (sbcl-cl-cffi-gtk-gdk): New variable. Pierre Neidhardt 2018-10-19gnu: Add sbcl-cl-cffi-gtk-gdk-pixbuf....* gnu/packages/lisp.scm (sbcl-cl-cffi-gtk-gdk-pixbuf): New variable. Pierre Neidhardt 2018-10-19gnu: Add sbcl-cl-cffi-gtk-pango....* gnu/packages/lisp.scm (sbcl-cl-cffi-gtk-pango): New variable. Pierre Neidhardt 2018-10-19gnu: Add sbcl-cl-cffi-gtk-cairo....* gnu/packages/lisp.scm (sbcl-cl-cffi-gtk-cairo): New variable. Pierre Neidhardt