From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id EBEPDLU7P2deQwEAe85BDQ:P1 (envelope-from ) for ; Thu, 21 Nov 2024 13:55:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id EBEPDLU7P2deQwEAe85BDQ (envelope-from ) for ; Thu, 21 Nov 2024 14:55:01 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="Er/g27Iv"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732197301; a=rsa-sha256; cv=none; b=WbMrKSxb5MojsZH9bXE3Fb1fJNzggXjGJSfKoj83Tf4EzmoiKoSuz0kmQg7Es8zRHBCrkP G3NMdIMEf6Tzp+KpClTnIqRCebJk0bZSuZn8g2gNT3KU0eJHLBR93uwSsIoB0S1HVhiie6 gCibMXw9LeBUrNa4iFCdTGqqeLB36GlyFoCQCSYz5EQZdcTRdNcsjrapzTw7/JGgIbBfeM bt88ZjXPJOsw/qqP7xuQuBwpVfsHJD5mb9nWdTtptTSQWKX2b6vOH/7intSe1ck3L8f4Tl kDupx0UFfHczcVjB269ulkhNdAA7awmVd2Wf4gUi3WLTuwLAhfiREDw6LgoXIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="Er/g27Iv"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732197301; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+ynSXFw41qFvNKfwle5yM67jfp7rJMvdayJ0yTWztTg=; b=Y15/m1rUwQyml4XSOSONLbFAxdZltfT6gzc9XhrGqcAgDsGEhilw2dsswTuhARCZymitMn b3h23i1uKSxSKVa30MGw4Pt1h1ojbJopvbY/Ko9fYAkK0UvSU6ebeSdeuEZX4ew6Of6y/+ twTJIPiP0oqIHEXtBuaHag4zVOm9vk2elOUx7HrEamTpXPL0Nca3sHyvB9JBaoUwlmM47N Go0MnjVfFTo6yvnR9p118HosSpK3Qex9RldEaEaZH4PHNg7HkrUMWTxtXn3aMdBEoiN5QM 5EVc1/zX9e8qV4kUomAlvD5YZ/c4f2Y3z7Lr5e2h03vwZN3xnt5/4VdbceoG/g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4CE5F384B for ; Thu, 21 Nov 2024 14:55:00 +0100 (CET) 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-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 4CE5F384B X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -5.55 X-Spam-Score: -5.55 X-TUID: tQrHzrlH/ko8 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: ™" -- 2.46.0