lint: Add a requires-store? field to the checker record.

This can then be used to mark checkers that require a store connection, which
will enable passing a connection in, avoiding the overhead of establishing a
connection inside the check function when it's run for lots of different
packages.

* guix/lint.scm (<lint-checker>): Add requires-store? to the record type.
This commit is contained in:
Christopher Baines 2020-03-15 18:48:01 +00:00
parent b14c234c0d
commit 3874dc5ef2
No known key found for this signature in database
GPG Key ID: 5E28A33B0B84F577
1 changed files with 5 additions and 2 deletions

View File

@ -100,7 +100,8 @@
lint-checker?
lint-checker-name
lint-checker-description
lint-checker-check))
lint-checker-check
lint-checker-requires-store?))
;;;
@ -155,7 +156,9 @@
;; 'certainty' level.
(name lint-checker-name)
(description lint-checker-description)
(check lint-checker-check))
(check lint-checker-check)
(requires-store? lint-checker-requires-store?
(default #f)))
(define (properly-starts-sentence? s)
(string-match "^[(\"'`[:upper:][:digit:]]" s))