lint: Verify if #:tests? is respected in the 'check' phase.
authorMaxime Devos <maximedevos@telenet.be>
Mon, 28 Jun 2021 18:44:16 +0000 (20:44 +0200)
committerMathieu Othacehe <othacehe@gnu.org>
Wed, 30 Jun 2021 11:53:00 +0000 (13:53 +0200)
commit5532371a3a25adaa023a00ae1004c2f422f3abc8
tree36b9ce9fcf4dbdebbf7cbbb418a97089c6ef18e8
parentd9e0ae07db5cb9f949c11f4ee77146a070c2618c
lint: Verify if #:tests? is respected in the 'check' phase.

There have been a few patches to the mailing list lately
not respecting this, and this linter detects 630 package
definitions that could be modified to support the --without-tests
package transformation.

* guix/lint.scm
  (check-optional-tests): New linter.
  (%local-checkers)[optional-tests]: Add it.
* tests/lint.scm
  (package-with-phase-changes): New procedure.
  ("optional-tests: no check phase")
  ("optional-tests: check hase respects #:tests?")
  ("optional-tests: check phase ignores #:tests?")
  ("optional-tests: do not crash when #:phases is invalid")
  ("optional-tests: allow G-exps (no warning)")
  ("optional-tests: allow G-exps (warning)")
  ("optional-tests: complicated 'check' phase")
  ("optional-tests: 'check' phase is not first phase"): New tests.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
guix/lint.scm
tests/lint.scm