[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/28: lint: Speed up the formatting linter.

From: guix-commits
Subject: 01/28: lint: Speed up the formatting linter.
Date: Sun, 5 Nov 2023 13:16:28 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit aa98a976079101318d53b412fef6c722bb4332c9
Author: Christopher Baines <>
AuthorDate: Sat Oct 28 15:16:08 2023 +0100

    lint: Speed up the formatting linter.
    By using go-to-location which caches the number of bytes to seek by to get 
    specific lines in a file.
    * guix/lint.scm (report-formatting-issues): Use go-to-location.
    Change-Id: I34e4d3acfbb1e14e026d2e7f712ba8d22b56c147
    Signed-off-by: Christopher Baines <>
 guix/lint.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 7ccf52dec1..861e352b93 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -1857,7 +1857,8 @@ them for PACKAGE."
   (call-with-input-file file
     (lambda (port)
-      (let loop ((line-number 1)
+      (go-to-location port starting-line 0)
+      (let loop ((line-number starting-line)
                  (last-line #f)
                  (warnings '()))
         (let ((line (read-line port)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]