From patchwork Thu Nov 21 12:43:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70624 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 5544227BBEA; Thu, 21 Nov 2024 12:44:07 +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=ham 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 00B7A27BBE2 for ; Thu, 21 Nov 2024 12:44:06 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6XT-00041d-G5; Thu, 21 Nov 2024 07:44:03 -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 1tE6XS-00041U-Mn for guix-patches@gnu.org; Thu, 21 Nov 2024 07:44:02 -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 1tE6XS-00068z-Dl for guix-patches@gnu.org; Thu, 21 Nov 2024 07:44: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=hi6N6/jKwiTrPzpPu/NpTFCJ6lGHg5iLL4LAuGetNzE=; b=dN9kIDEroadmIq+Evkc0GKg/gnw0hbulW8TYz3UPXw81V3Fk8ouDMQs1EN6Vgv0TIPBQ0MNW/7xcjs3tqvZCgyRkLRoqKG0yCtAs87hYtXcqmpOAGlQZJROuusGs/lr5cKhgvOavSxUJeqxCZsENQS+SuJ6SxuaFUeU4jhgDeEF1XH9s0hYQWRZSWf1PnysnzkQB4VEr5lswPPenuZEkYIUnKgmU6qPhq4Gd2mEeI1xHEmRVsi4gP0I8OlQlT2/UITLzXzvbIb9ItjBy7Pa6Jfm7Lsea1DyP67dsDIIJ3uw0R8c1kYrH8PzZrJZxvZs4kBkU1UjNiPoQlYWGK/kMBg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6XS-0000RA-5b for guix-patches@gnu.org; Thu, 21 Nov 2024 07:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 1/8] guix: lint: Fix indentation. 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:44: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.17321929921600 (code B ref 74459); Thu, 21 Nov 2024 12:44:02 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:43:12 +0000 Received: from localhost ([127.0.0.1]:49422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6Wd-0000Pk-R6 for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:43:12 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:41423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6Wb-0000PS-W4 for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:43:10 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id 70AE820026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:43:04 +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 EUCg2IO3vk-n for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:43:03 +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:43:03 +0100 (CET) Date: Thu, 21 Nov 2024 13:43:00 +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-synopsis-style): Add white space. * tests/lint.scm: Fix indentation. --- guix/lint.scm | 2 +- tests/lint.scm | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 8c6c20c723..31d366af46 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -737,7 +737,7 @@ (define (check-synopsis-style package) (define (check-start-with-package-name synopsis) (if (and (regexp-exec (package-name-regexp package) synopsis) - (not (starts-with-abbreviation? synopsis))) + (not (starts-with-abbreviation? synopsis))) (list (make-warning package (G_ "synopsis should not start with the package name") diff --git a/tests/lint.scm b/tests/lint.scm index 95d82d7490..b899ebc700 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -171,14 +171,14 @@ (define (warning-contains? str warnings) "description contains leading whitespace" (single-lint-warning-message (let ((pkg (dummy-package "x" - (description " Whitespace.")))) + (description " Whitespace.")))) (check-description-style pkg)))) (test-equal "description: trailing whitespace" "description contains trailing whitespace" (single-lint-warning-message (let ((pkg (dummy-package "x" - (description "Whitespace. ")))) + (description "Whitespace. ")))) (check-description-style pkg)))) (test-equal "description: pluralized 'This package'" @@ -359,18 +359,18 @@ (define (warning-contains? str warnings) '() (check-compiler-for-target (dummy-package "x" - (arguments - (list #:make-flags - #~(list (string-append "CC=" (cc-for-target)))))))) + (arguments + (list #:make-flags + #~(list (string-append "CC=" (cc-for-target)))))))) (test-equal "compiler-for-target: CC=gcc is acceptable when target=#false" '() (check-compiler-for-target ;; This (dummy) package consists purely of architecture-independent data. (dummy-package "tzdata" - (arguments - (list #:target #false - #:make-flags #~(list "CC=gcc")))))) + (arguments + (list #:target #false + #:make-flags #~(list "CC=gcc")))))) ;; The emacs-build-system sets #:tests? #f by default. (test-equal "tests-true: #:tests? #t acceptable for emacs packages" From patchwork Thu Nov 21 12:44:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70625 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 A519A27BBEA; Thu, 21 Nov 2024 12:46:18 +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=ham 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 A007527BBE2 for ; Thu, 21 Nov 2024 12:46:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6ZW-0004Lg-Lp; Thu, 21 Nov 2024 07:46:10 -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 1tE6ZP-0004Ku-Rp for guix-patches@gnu.org; Thu, 21 Nov 2024 07:46:04 -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 1tE6ZO-0006vP-0Z for guix-patches@gnu.org; Thu, 21 Nov 2024 07:46:03 -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=qZpi51ataTgQa4NFq2wLpOxyuEVMz+uXoqA3q/N+ceE=; b=P3rDxq0HqxLia6n0BujPhlxSLfwbZyZ8WKpvIUGWMVmn2U4/yuUnCeIMVuY3bAqRZOXalEID8LGrKxFCNbAlOIUL/KozD71RsviLq4jhPhqgaysLAXz+jX2hwHaZfrY7dt702yIj8WRKjbxcONfZQSYT5d2+39y8rigPLiCuqNG10OBbLVeQq36c0TpwlksGHU6Gpyk5nG/0onUsCnUe2AG2PnjlxvLI1Q8xNxwhbqTj7152fB39Un8OBMEGvMSsRE/MDUosa4rc/IF5IocACYE+ycPKhkKz5M+U7UOZ7lVL8qPsgOgTR+BVRbAhTwI2+g5kAKRrJ2M90yz9asYHuQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6ZN-0000ad-Qs for guix-patches@gnu.org; Thu, 21 Nov 2024 07:46:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 2/8] guix: lint: Refine description start check logic. 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:46:01 +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.17321931141838 (code B ref 74459); Thu, 21 Nov 2024 12:46:01 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:45:14 +0000 Received: from localhost ([127.0.0.1]:49428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6YY-0000TQ-CD for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:45:14 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:53547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6YT-0000SX-7K for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:45:09 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id D4BF720026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:44:59 +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 ARlIq4z8b3LH for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:44:55 +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:44:55 +0100 (CET) Date: Thu, 21 Nov 2024 13:44:52 +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 Fix linter warnings for the following: - packages that belong to some programming language or ecosystem, e.g. python-foo or texlive-bar, - packages whose names end in a version distinction, e.g. wlroots-0.16 and - packages where the software's real name contains an underscore `_' character where our package name replaced that with a hyphen `-', e.g. wpa_supplicant and wpa-supplicant-minimal. * guix/lint.scm (check-description-style)[check-proper-start]: Add conditions. * tests/lint.scm: New tests. Change-Id: Ifc9f5cda04db59e460e287cd93afae89c7f17e3c --- guix/lint.scm | 24 +++++++++++++++--------- tests/lint.scm | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 31d366af46..39edf93219 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021-2023 Maxime Devos ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2024 Gabriel Wicki ;;; ;;; This file is part of GNU Guix. ;;; @@ -437,15 +438,20 @@ (define (check-description-style package) '())) (define (check-proper-start description) - (if (or (string-null? description) - (properly-starts-sentence? description) - (string-prefix-ci? (package-name package) description)) - '() - (list - (make-warning - package - (G_ "description should start with an upper-case letter or digit") - #:field 'description)))) + (let* ((initial (car (string-split description #\space))) + (first-word + (regexp-substitute/global #f "_" initial + 'pre "-" 'post))) + (if (or (string-null? description) + (properly-starts-sentence? description) + (string-prefix-ci? first-word (package-name package)) + (string-suffix-ci? first-word (package-name package))) + '() + (list + (make-warning + package + (G_ "description should start with an upper-case letter or digit") + #:field 'description))))) (define (check-end-of-sentence-space description) "Check that an end-of-sentence period is followed by two spaces." diff --git a/tests/lint.scm b/tests/lint.scm index b899ebc700..9297bfbaac 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021, 2023 Maxime Devos +;;; Copyright © 2024 Gabriel Wicki ;;; ;;; This file is part of GNU Guix. ;;; @@ -132,6 +133,30 @@ (define (warning-contains? str warnings) (description "x is a dummy package.")))) (check-description-style pkg))) +(test-equal "description: may start with beginning of package name" + '() + (let ((pkg (dummy-package "xyz-0.1" + (description "xyz is a dummy package.")))) + (check-description-style pkg))) + +(test-equal "description: may start with end of package name" + '() + (let ((pkg (dummy-package "foobar-xyz" + (description "xyz is a dummy package.")))) + (check-description-style pkg))) + +(test-equal "description: may start with non-hyphenated package name" + '() + (let ((pkg (dummy-package "foobar-xyz-minimal" + (description "foobar_xyz is a dummy package.")))) + (check-description-style pkg))) + +(test-equal "description: may start with end of package name" + '() + (let ((pkg (dummy-package "foo-bar" + (description "bar is some thing in foo.")))) + (check-description-style pkg))) + (test-equal "description: two spaces after end of sentence" "sentences in description should be followed by two spaces; possible infraction at 3" (single-lint-warning-message From patchwork Thu Nov 21 12:45:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70626 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 38A2D27BBEA; Thu, 21 Nov 2024 12:46:23 +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=ham 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 E873C27BBE2 for ; Thu, 21 Nov 2024 12:46:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6ZW-0004Lf-LZ; Thu, 21 Nov 2024 07:46:10 -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 1tE6ZP-0004Kt-Ra for guix-patches@gnu.org; Thu, 21 Nov 2024 07:46:04 -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 1tE6ZO-0006vQ-G2 for guix-patches@gnu.org; Thu, 21 Nov 2024 07:46:03 -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=R9uQCdpV1veOMltZKKNVVsKRrzbgnwm77+Z8bmiK3Gk=; b=TJ0cld2u2naVmCjRos2l1KV5oQU1lriUS9sV+QfZ4Yn6x0efQeGypC2usnKzBMDHHtAXZ84KpU7NgLpWygwVjy31SI8hAgv4VHGH6miMld4LEHTaN0JprlYDTSwPuX3AAra7q9sye5rZTfx6fX5OBE48AKoGH0W350W1O9kpBRWUXZBqaZw+x/Kh34FiGIlysMdlSqalLNOyc0Fs9QgzdDjrshQEnOLsUlH55srdK4UWgq/9IOaNm8ZGj1Lx5PHySdjImBvf0SfWZjGGKAF6RBDsFouZu2XDHTzyVm1F1GyJu5xoAdSO+aq+AiL7FkLywfLHWL+AkY7RPNOhsKrmfg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6ZO-0000ak-AP for guix-patches@gnu.org; Thu, 21 Nov 2024 07:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 3/8] guix: lint: Allow texinfo markup at beginning of description. 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:46: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.17321931402231 (code B ref 74459); Thu, 21 Nov 2024 12:46:02 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:45:40 +0000 Received: from localhost ([127.0.0.1]:49434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6Z2-0000Zu-7z for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:45:40 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:38983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6Z0-0000Zb-8K for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:45:38 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id DE43720026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:45:32 +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 6cBEWO_EjTAf for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:45:32 +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:45:31 +0100 (CET) Date: Thu, 21 Nov 2024 13:45:28 +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(starts-with-texinfo-markup?): New function. (check-description-style)[check-proper-start]: Add condition. * tests/lint.scm: Add test case. Change-Id: I674988882265d9e2041d48dba0f9627cd68bf292 --- guix/lint.scm | 8 +++++++- tests/lint.scm | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/guix/lint.scm b/guix/lint.scm index 39edf93219..4ea02a7faa 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -370,6 +370,9 @@ (define (check-compiler-for-target package) (define (properly-starts-sentence? s) (string-match "^[(\"'`[:upper:][:digit:]]" s)) +(define (starts-with-texinfo-markup? s) + (string-match "^@(acronym|dfn|code|command|emph|file|quotation|samp|uref|url)\\{.*?\\}" s)) + (define (starts-with-abbreviation? s) "Return #t if S starts with what looks like an abbreviation or acronym." (string-match "^[A-Z][A-Z0-9]+\\>" s)) @@ -444,6 +447,7 @@ (define (check-description-style package) 'pre "-" 'post))) (if (or (string-null? description) (properly-starts-sentence? description) + (starts-with-texinfo-markup? description) (string-prefix-ci? first-word (package-name package)) (string-suffix-ci? first-word (package-name package))) '() @@ -510,7 +514,9 @@ (define (check-description-style package) (match (check-texinfo-markup description) ((and warning (? lint-warning?)) (list warning)) (plain-description - (check-proper-start plain-description)))) + (if (string-prefix? "@" description) + '() + (check-proper-start plain-description))))) (list (make-warning package (G_ "invalid description: ~s") diff --git a/tests/lint.scm b/tests/lint.scm index 9297bfbaac..df7042c470 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -121,6 +121,11 @@ (define (warning-contains? str warnings) (description "bad description.")))) (check-description-style pkg)))) +(test-equal "description: may start with texinfo markup" + '() + (check-description-style + (dummy-package "x" (description "@emph{Maxwell Equations of Software}")))) + (test-equal "description: may start with a digit" '() (let ((pkg (dummy-package "x" From patchwork Thu Nov 21 12:46:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70627 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 57B1427BBEA; Thu, 21 Nov 2024 12:47:26 +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=ham 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 F156027BBE2 for ; Thu, 21 Nov 2024 12:47:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6aQ-0004Zg-QA; Thu, 21 Nov 2024 07:47: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 1tE6aM-0004YR-Ec for guix-patches@gnu.org; Thu, 21 Nov 2024 07:47:02 -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 1tE6aM-000709-3H for guix-patches@gnu.org; Thu, 21 Nov 2024 07:47: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=OodUJEBNysnnXmlMM9XnrruZqQiPpuxLP6a65Zlgiro=; b=Llo4YZ+dP8oP/+Yw9Q+8oCQ1CWkYGwGBy4Z2WitbELG+nYavXHVirSvhZx1BC5011/m5vMCQMmt3UFpOvqdV65qggDS71MRmXv+MNddgexus9m3nQiXsMhUrmFOyfOtNlJhKl2L7BSX0S4dhZK5ukp/vL/dsbqvPa+bUWZjBbMU2vqX9PFQ6gSFsqEwDFCHZDZ+ysU6y5YFO8eUWlIdymkJ30uV7OnWOlQJmUGwAya2m8q06ql6PRanIAaJv4MKmRTRPwmsTfRS6zyxmrz6P1Ke0MB0VYUtLqtMDf54MVtet1UrgAn7jeCmW5ZgmuorSMwJBwpnF3dM3nT/j+2kvHg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6aL-0000ce-Tt for guix-patches@gnu.org; Thu, 21 Nov 2024 07:47:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 4/8] guix: lint: Allow texinfo markup at beginning of synopsis. 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:47:01 +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.17321931912354 (code B ref 74459); Thu, 21 Nov 2024 12:47:01 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:46:31 +0000 Received: from localhost ([127.0.0.1]:49439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6Zm-0000bd-LT for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:46:31 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:38951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6Zk-0000bL-2p for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:46:24 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id B31D120026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:46:18 +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 s9QxLdghsqyb for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:46:17 +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:46:17 +0100 (CET) Date: Thu, 21 Nov 2024 13:46:15 +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-synopsis-style)[check-proper-start]: Add condition. * tests/lint.scm: Add test case. Change-Id: I2509b3a4e7e51c6a274697ceb5f776c22e27c5f9 --- guix/lint.scm | 3 ++- tests/lint.scm | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/guix/lint.scm b/guix/lint.scm index 4ea02a7faa..9fa22c92cc 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -740,7 +740,8 @@ (define (check-synopsis-style package) '())) (define (check-proper-start synopsis) - (if (properly-starts-sentence? synopsis) + (if (or (properly-starts-sentence? synopsis) + (starts-with-texinfo-markup? synopsis)) '() (list (make-warning package diff --git a/tests/lint.scm b/tests/lint.scm index df7042c470..6631034151 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -307,6 +307,12 @@ (define (warning-contains? str warnings) (check-synopsis-style pkg))) string 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 From patchwork Thu Nov 21 12:48:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70629 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 51ECA27BBEA; Thu, 21 Nov 2024 12:49:22 +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=ham 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 F1F2627BBE2 for ; Thu, 21 Nov 2024 12:49:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6cK-0005BQ-HN; Thu, 21 Nov 2024 07:49:04 -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 1tE6cI-0005BA-JN for guix-patches@gnu.org; Thu, 21 Nov 2024 07:49: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 1tE6cI-0007Ng-Ar for guix-patches@gnu.org; Thu, 21 Nov 2024 07:49: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=+ynSXFw41qFvNKfwle5yM67jfp7rJMvdayJ0yTWztTg=; b=Er/g27Iv7GbWaxGXdqcgBZ5ReRAik3Z/Fw/QG3l1z/kHi1S/b7WxUdzwns9wzyYHmdzriKOOBBBfxYtiOkAxGRLmKG4tpJ/4y+ZbW7++Nhbi/M5xaB39uu3wLwVyXd90He8nvY7ccMeLD/NmpXe7fMRPKHREpSftgpECSjan32538L1fz0cb6SkfDFPmm6SOalbaRFrHB449l1ACLQE1R0q+rKtUm7IDPalOpDKsymNADFtieZvzV10JkILTj3Oqamf6WAfUMBnh1Qgvbdm1XD6avZ2pxvN/eM7U3u3XYXLh9hdMQFdirs+c9Kda79bcM3DwgXjYDjvc6Ekg1oN9Tg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6cI-0000go-4L for guix-patches@gnu.org; Thu, 21 Nov 2024 07:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 6/8] guix: lint: Ignore initials from double space 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:49: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.17321933052602 (code B ref 74459); Thu, 21 Nov 2024 12:49:02 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:48:25 +0000 Received: from localhost ([127.0.0.1]:49460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6bh-0000fs-93 for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:48:25 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:39045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6be-0000fe-6H for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:48:24 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id 9EB4820026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:48:16 +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 iIIb-bF2OF5V for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:48:15 +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:48:15 +0100 (CET) Date: Thu, 21 Nov 2024 13:48:13 +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 Prevent false positives in initials as the are commonly used in names, e.g. Margaret E. Hamilton - which obviously do not end sentences. Check whether a period character `.' is preceded by at least two characters. This should save us from false positives when linting. * guix/lint.scm(check-description-style)[check-end-of-sentence-space] Add condition. * tests/lint.scm: Add test case. Change-Id: I42a1365aaaed2afc7308b88ebd4b0720ad362761 --- guix/lint.scm | 15 ++++++++++----- tests/lint.scm | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index 6122a9c8e3..f2e8e95e61 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -463,11 +463,16 @@ (define (check-description-style package) (reverse (fold-matches "\\. [A-Z]" description '() (lambda (m r) - ;; Filter out matches of common abbreviations. - (if (find (lambda (s) - (string-suffix-ci? s (match:prefix m))) - '("i.e" "e.g" "a.k.a" "resp")) - r (cons (match:start m) r))))))) + ;; Filter out matches of common abbreviations and + ;; initials. + (let ((pre (match:prefix m))) + (if (or + (string-match "[A-Z]$" pre) ;; Initial found + (find (lambda (s) + (string-suffix-ci? s pre)) + '("i.e" "e.g" "a.k.a" "resp"))) + r + (cons (match:start m) r)))))))) (if (null? infractions) '() (list diff --git a/tests/lint.scm b/tests/lint.scm index 47e31a69bf..09be160f5d 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -173,7 +173,7 @@ (define (warning-contains? str warnings) '() (let ((pkg (dummy-package "x" (description - "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) + "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD). Name O. Person")))) (check-description-style pkg))) (test-equal "description: may not contain trademark signs: ™" From patchwork Thu Nov 21 12:49:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriel Wicki X-Patchwork-Id: 70630 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 5A16727BBEA; Thu, 21 Nov 2024 12:50:20 +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=ham 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 1D75627BBE2 for ; Thu, 21 Nov 2024 12:50:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE6dL-0005Ku-4E; Thu, 21 Nov 2024 07:50:07 -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 1tE6dG-0005I5-Eq for guix-patches@gnu.org; Thu, 21 Nov 2024 07:50:04 -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 1tE6dG-0007Tb-0P for guix-patches@gnu.org; Thu, 21 Nov 2024 07:50: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=ucm0LeY/sjvIMdajnOCFt2bdYJJ9qsVdj5lgoNre1m0=; b=vUJAA6f1eNFY7uqzY0tk1MA6FAwa/nBzvUD7p0Q1+IXtORyId1XwDYmnS22LwhiqJzIB20RvZXS5fBhIjwKageMLf5IWP0Cl/RMmYJrcfbfUbskF+tKgmj7tS9LmwOyMYRFDwfnnseYdqW9HE7H4Nz2OoyArm1/qhM0V2Jq+jVPY+WJLeYN6XhzERZrNTBB3mVO2VaEpeQRPkiPrvoVXeF3Jk0jUtizZKibf/19SarEhV2ebHEEzZ/UY+dbObHoMmpDfZO3OtBABWL78Pf7vFeAUSCRHRejUeZKrtNOSBN/UbMEETBbs2tc5DoOo0Knj1J1OZnGjxN9D5JqKoNHf2Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tE6dF-0000ie-Pq for guix-patches@gnu.org; Thu, 21 Nov 2024 07:50:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH 7/8] guix: lint: More abbreviations. 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:50:01 +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.17321933902735 (code B ref 74459); Thu, 21 Nov 2024 12:50:01 +0000 Received: (at 74459) by debbugs.gnu.org; 21 Nov 2024 12:49:50 +0000 Received: from localhost ([127.0.0.1]:49464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6d3-0000i2-OE for submit@debbugs.gnu.org; Thu, 21 Nov 2024 07:49:50 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:49739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE6d1-0000hp-0U for 74459@debbugs.gnu.org; Thu, 21 Nov 2024 07:49:47 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id 8CBE820026 for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:49:41 +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 D_6DNamhP_ec for <74459@debbugs.gnu.org>; Thu, 21 Nov 2024 13:49: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:49:40 +0100 (CET) Date: Thu, 21 Nov 2024 13:49: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: Allow more common abbreviations in double-space-after sentence check. * tests/lint.scm: Add tests. Change-Id: I0eedf73e5fcd0a8c67b3ae3dfa979a57fe0f6253 --- guix/lint.scm | 2 +- tests/lint.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/lint.scm b/guix/lint.scm index f2e8e95e61..b1c8834c5f 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -470,7 +470,7 @@ (define (check-description-style package) (string-match "[A-Z]$" pre) ;; Initial found (find (lambda (s) (string-suffix-ci? s pre)) - '("i.e" "e.g" "a.k.a" "resp"))) + '("i.e" "e.g" "a.k.a" "resp" "cf" "al"))) r (cons (match:start m) r)))))))) (if (null? infractions) diff --git a/tests/lint.scm b/tests/lint.scm index 09be160f5d..3e9dbd29db 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -173,7 +173,7 @@ (define (warning-contains? str warnings) '() (let ((pkg (dummy-package "x" (description - "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD). Name O. Person")))) + "O. Person e.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD). Name et al. cf. some paper.")))) (check-description-style pkg))) (test-equal "description: may not contain trademark signs: ™"