diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-05-20 16:17:00 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-07-11 00:49:14 +0200 |
commit | b7f1b4c1d072c6da92e20ddadb24e54da0ddd142 (patch) | |
tree | 13d212f653f8068f7f8c69cf5fe510bfd6ab9d1b /tests | |
parent | 8524349f78c37439698f29d43049c2b21df6370f (diff) | |
download | guix-b7f1b4c1d072c6da92e20ddadb24e54da0ddd142.tar.gz |
lint: Add 'input-labels' checker.
* guix/lint.scm (check-input-labels): New procedure. (%local-checkers): Add 'input-labels' checker. * tests/lint.scm ("input labels: no warnings") ("input labels: one warning"): New tests. * doc/guix.texi (Invoking guix lint): Mention it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lint.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm index 6222c3b15a..0a8f1c6f54 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -356,6 +356,20 @@ `(("python-setuptools" ,python-setuptools)))))) (check-inputs-should-not-be-an-input-at-all pkg)))) +(test-assert "input labels: no warnings" + (let ((pkg (dummy-package "x" + (inputs `(("glib" ,glib) + ("pkg-config" ,pkg-config)))))) + (null? (check-input-labels pkg)))) + +(test-equal "input labels: one warning" + "label 'pkgkonfig' does not match package name 'pkg-config'" + (single-lint-warning-message + (let ((pkg (dummy-package "x" + (inputs `(("glib" ,glib) + ("pkgkonfig" ,pkg-config)))))) + (check-input-labels pkg)))) + (test-equal "file patches: different file name -> warning" "file names of patches should start with the package name" (single-lint-warning-message |