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.
This commit is contained in:
Ludovic Courtès 2021-05-20 16:17:00 +02:00
parent 8524349f78
commit b7f1b4c1d0
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 56 additions and 0 deletions

View file

@ -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