unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: guix lint false positives and RFC patch
Date: Sat, 12 Nov 2022 17:54:36 -0800	[thread overview]
Message-ID: <87v8njliub.fsf@contorta> (raw)
In-Reply-To: <87k049jnl9.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3114 bytes --]

On 2022-11-05, Ludovic Courtès wrote:
> Vagrant Cascadian <vagrant@debian.org> skribis:
>> From bfa13fdd3616839883e50efbbc05fb132610ce67 Mon Sep 17 00:00:00 2001
>> From: Vagrant Cascadian <vagrant@debian.org>
>> Date: Wed, 2 Nov 2022 19:56:12 -0700
>> Subject: [PATCH 01/12] guix: lint: Exclude some "@" symbols from various
>>  checks.
>>
>> The visual representation of "@code{}" or similar in the description and
>> synopsis do not include the string, so exclude it from checks to avoid false
>> positives.
>>
>> FIXME handle @command, @file, @acronym, etc.
>>
>> * guix/linx.scm (properly-starts-sentence): Exclude leading "@".
>>   (check-synopsis-length): Exclude "@code" and "@acronym".
>
> LGTM!  Bonus points for a test in ‘tests/lint.scm’.  :-)

No bonus points for me just yet...

diff --git a/tests/lint.scm b/tests/lint.scm
index ce22e2355a..26e93ca37b 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -283,6 +283,16 @@ (define (warning-contains? str warnings)
                              (synopsis (make-string 80 #\X)))))
      (check-synopsis-style pkg))))

+(test-equal "synopsis: exclude @code from long synopsis"
+  '()
+  (single-lint-warning-message
+   (let ((pkg (dummy-package "x"
+                             (synopsis
+                              (string-append
+                                        "@code{X}"
+                                        (make-string 72 #\X))))))
+     (check-synopsis-style pkg))))
+
 (test-equal "synopsis: start with package name"
   "synopsis should not start with the package name"
   (single-lint-warning-message

The above test doesn't catch this issue, even though the code works on
real packages... I am a bit stumped as to why. I guess '() (or "" which
I also tried) is not a valid way to try to express "this test expects no
warning/error/message/etc."?

Here is a log from the test I cargo-culted:

test-name: synopsis: too long
location: /home/vagrant/src/guix/tests/lint.scm:279
source:
+ (test-equal
+   "synopsis: too long"
+   "synopsis should be less than 80 characters long"
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (synopsis (make-string 80 #\X)))))
+       (check-synopsis-style pkg))))
expected-value: "synopsis should be less than 80 characters long"
actual-value: "synopsis should be less than 80 characters long"
result: PASS

And from my test in the patch listed above:

test-name: synopsis: exclude @code from long synopsis
location: /home/vagrant/src/guix/tests/lint.scm:286
source:
+ (test-equal
+   "synopsis: exclude @code from long synopsis"
+   '()
+   (single-lint-warning-message
+     (let ((pkg (dummy-package
+                  "x"
+                  (synopsis
+                    (string-append "@code{X}" (make-string 72 #\X))))))
+       (check-synopsis-style pkg))))
expected-value: ()
actual-value: #f
actual-error:
+ (match-error "match" "no matching pattern" ())
result: FAIL


What is failing to match what here?


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2022-11-13  1:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  3:29 guix lint false positives and RFC patch Vagrant Cascadian
2022-11-03 15:20 ` Ludovic Courtès
2022-11-03 23:46   ` Vagrant Cascadian
2022-11-04 22:24     ` Vagrant Cascadian
2022-11-05 17:52       ` Ludovic Courtès
2022-11-13  1:54         ` Vagrant Cascadian [this message]
2022-11-17 15:03           ` Ludovic Courtès
2023-01-27 17:42           ` Simon Tournier
2023-01-28 21:07             ` Vagrant Cascadian
2023-01-28 21:24               ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8njliub.fsf@contorta \
    --to=vagrant@debian.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).