GNU bug report logs - #74459
[PATCH 0/8] Linter improvements (eliminate false positives)

Previous Next

Package: guix-patches;

Reported by: Gabriel Wicki <gabriel <at> erlikon.ch>

Date: Thu, 21 Nov 2024 12:41:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #52 received at 74459 <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Wicki <gabriel <at> erlikon.ch>
To: 74459 <at> debbugs.gnu.org
Subject: [PATCH v2 5/7] guix: lint: Prevent false positives in description
 typo check.
Date: Mon, 2 Dec 2024 23:38:51 +0100
* guix/lint.scm(check-description-style)[check-description-typo]: Add spaces
to match strings to prevent matching false positives, like "allows tokens" or
"prevents torpedoes".
* tests/lint.scm: Add test.

Change-Id: Ifc2ec6167a590b9d2e742dd86fecd798c4bfaa24
---
 guix/lint.scm  | 4 ++--
 tests/lint.scm | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 396ee01fed..ee2059d812 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -507,8 +507,8 @@ (define (check-description-style package)
          (check-trademarks description)
          (check-description-typo description '(("This packages" . "This package")
                                                ("This modules" . "This module")
-                                               ("allows to" . #f)
-                                               ("permits to" . #f)))
+                                               ("allows to " . #f)
+                                               ("permits to " . #f)))
          ;; Use raw description for this because Texinfo rendering
          ;; automatically fixes end of sentence space.
          (check-end-of-sentence-space description)
diff --git a/tests/lint.scm b/tests/lint.scm
index 6631034151..47e31a69bf 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -219,12 +219,18 @@ (define (warning-contains? str warnings)
      (check-description-style pkg))))
 
 (test-equal "description: grammar 'allows to'"
-  "description contains typo 'allows to'"
+  "description contains typo 'allows to '"
   (single-lint-warning-message
    (let ((pkg (dummy-package "x"
                              (description "This package allows to do stuff."))))
      (check-description-style pkg))))
 
+(test-equal "description: grammar 'allows to' 2"
+  '()
+  (let ((pkg (dummy-package "x"
+                            (description "This package allows tokenization."))))
+    (check-description-style pkg)))
+
 (test-equal "synopsis: not a string"
   "invalid synopsis: #f"
   (single-lint-warning-message
-- 
2.46.0





This bug report was last modified 164 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.