From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:33455) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDaTQ-0005lO-8x for guix-patches@gnu.org; Sun, 15 Mar 2020 17:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDaTP-000891-9c for guix-patches@gnu.org; Sun, 15 Mar 2020 17:07:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57969) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDaTP-00088F-64 for guix-patches@gnu.org; Sun, 15 Mar 2020 17:07:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jDaTP-0000B2-1G for guix-patches@gnu.org; Sun, 15 Mar 2020 17:07:03 -0400 Subject: [bug#38754] [PATCH 1/4] lint: Add a requires-store? field to the checker record. Resent-Message-ID: From: Christopher Baines Date: Sun, 15 Mar 2020 21:06:28 +0000 Message-Id: <20200315210631.5334-1-mail@cbaines.net> In-Reply-To: <87lfqsxsxn.fsf@gnu.org> References: <87lfqsxsxn.fsf@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38754@debbugs.gnu.org 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 (): Add requires-store? to the record type. --- guix/lint.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 24fbf05202..2a084382c6 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)) -- 2.25.0