aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-03-15 18:48:01 +0000
committerChristopher Baines <mail@cbaines.net>2020-03-24 19:47:43 +0000
commit3874dc5ef2e0d301dc708bf433e13362e0759a0a (patch)
treed991dc993757cd07d40f303142523b2bffd5665d
parentb14c234c0d32216f8c2f6e6d1935c469a6b947c9 (diff)
downloadpatches-3874dc5ef2e0d301dc708bf433e13362e0759a0a.tar
patches-3874dc5ef2e0d301dc708bf433e13362e0759a0a.tar.gz
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.
-rw-r--r--guix/lint.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/lint.scm b/guix/lint.scm
index 40bddd0a41..a324858f68 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -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))