diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-11-19 18:06:46 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-11-19 18:44:53 +0100 |
commit | fac46e3f5e55f9de6fa2ab8082bc418139590fc0 (patch) | |
tree | dc7c03992475f5826a6fa948edf8705feff787d0 /tests | |
parent | e74f64b9e55cbc3052698830001238d2407fed19 (diff) | |
download | guix-fac46e3f5e55f9de6fa2ab8082bc418139590fc0.tar guix-fac46e3f5e55f9de6fa2ab8082bc418139590fc0.tar.gz |
lint: Add 'mirror-url' checker.
* guix/scripts/lint.scm (origin-uris): New procedure.
(check-source): Use it.
(check-mirror-url): New procedure.
(%checkers): Add 'mirror-url' checker.
* tests/lint.scm ("mirror-url")
("mirror-url: one suggestion"): New tests.
* doc/guix.texi (Invoking guix lint): Document it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lint.scm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index cf1b95ee69..0c534562a4 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -508,6 +508,25 @@ (check-source pkg)))) "not reachable: 404"))) +(test-assert "mirror-url" + (string-null? + (with-warnings + (let ((source (origin + (method url-fetch) + (uri "http://example.org/foo/bar.tar.gz") + (sha256 %null-sha256)))) + (check-mirror-url (dummy-package "x" (source source))))))) + +(test-assert "mirror-url: one suggestion" + (string-contains + (with-warnings + (let ((source (origin + (method url-fetch) + (uri "http://ftp.gnu.org/pub/gnu/foo/foo.tar.gz") + (sha256 %null-sha256)))) + (check-mirror-url (dummy-package "x" (source source))))) + "mirror://gnu/foo/foo.tar.gz")) + (test-assert "cve" (mock ((guix scripts lint) package-vulnerabilities (const '())) (string-null? |