From patchwork Thu Nov 21 12:47:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70628 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0A54C27BBE9; Thu, 21 Nov 2024 12:48:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DAB7727BBE2 for ; Thu, 21 Nov 2024 12:48:08 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6bO-0004tE-89; Thu, 21 Nov 2024 07:48:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tE6bK-0004rM-VY for guix-patches@gnu.org; Thu, 21 Nov 2024 07:48:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tE6bK-0007FJ-N5 for guix-patches@gnu.org; Thu, 21 Nov 2024 07:48:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:In-Reply-To:References:Subject; bh=69+Bo8BCmRFscAgpR9mEqF33a+wFtj+MCgmSdnf3COM=; b=Y/YowxXHEdGLmEhWrArSELWNSSVS2snRXqil+g++QpfgPz8hlcXKkFL7ZMQmFcavwIuSI1ERS8u4wvApr5nFLCrhHlVFk074EsfAgDN4WHE7e78i224Rao3IbnpmVumyH7DwTn+hg7kGviBa19Fj1RRPBs9ECnIweOxcZ3qoSF6PDXv083HfgS5viMAZjj6lA73OyHtUkkaPVZV3WxdgQQKWnnUVjqG+Q5Vlxp4mKJY76jL9e02YXDRhecH6TYrvTsSuN5WNjtkwpMDWR66waOZF1FiRQn7Tg6qWsCK/m1r5dhvhltgOf0uv18Qlec+SkvXOQNCdK6L2YtSDyKotag==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6bK-0000es-G6 for guix-patches@gnu.org; Thu, 21 Nov 2024 07:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 5/8] guix: lint: Prevent false positives in description typo check. References: In-Reply-To: Resent-From: Gabriel Wicki Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Nov 2024 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74459 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74459@debbugs.gnu.org Received: via spool by 74459-submit@debbugs.gnu.org id=B74459.17321932692487 (code B ref 74459); Thu, 21 Nov 2024 12:48:02 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:47:49 +0000 Received: from localhost ([127.0.0.1]:49443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6b7-0000e3-8v for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:47:49 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:45643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6b5-0000dq-BR for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:47:48 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id 00D1420026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:47:42 +0100 (CET) X-Virus-Scanned: by amavisd at antispam.ee.ethz.ch Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]) by localhost (antispam.ee.ethz.ch [129.132.2.16]) (amavisd-new, port 10028) with ESMTP id B-5JQczy4rCV for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:47:40 +0100 (CET) Received: from blackbox (212-51-128-25.fiber7.init7.net [212.51.128.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: gabriel) by cotopaxi.ee.ethz.ch (Postfix) with ESMTPSA for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:47:40 +0100 (CET) Date: Thu, 21 Nov 2024 13:47:37 +0100 From: Gabriel Wicki Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 9fa22c92cc..6122a9c8e3 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -504,8 +504,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