From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 MJD8M8o2P2dFMQAA62LTzQ:P1 (envelope-from ) for ; Thu, 21 Nov 2024 13:34:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id MJD8M8o2P2dFMQAA62LTzQ (envelope-from ) for ; Thu, 21 Nov 2024 14:34:02 +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=TJ0cld2u; 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=1732196042; a=rsa-sha256; cv=none; b=j5J9UlefKHwjUedncDqgko+NsXT1x6xxWw1Rryw795Iym6oU6MPKijC2FhV2QwljmKM49s shtRgAPJ1fbMwhQWhpz2d+hQHyKjwS3H2Kn1xawOGjUCpDuOKAdOZ53N4D4EhrbnrMInXe dYyQpqS+PkllwJNfkjxX1dVv2IqRmDz48q+RY7DQCv791TdYuLtJxenuOlgD3lClSC866m dAG5Jja4IWfbFF3OwbYq16mo0jc/35NU/Lx7Z1sjbuGLV5kpIgwdkpgx1dGghPPvOKucw5 C8ou1W3kYBDZUpTFgrGQT2OHfWJA3xsoGmvATijkxCoIf6fLEtHgz4kLBgwDEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=TJ0cld2u; 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=1732196042; 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: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=R9uQCdpV1veOMltZKKNVVsKRrzbgnwm77+Z8bmiK3Gk=; b=SLzPXb1/t48nV1BpTfHlVETj2643kWddbyF/liu+hmn19Y72YCoK3j21TeCcEEJhP51V7O 8zA8dwgXgeOt6TtifcYpLgQqKi5cD6IpeQe3B9zx+OlkOyMJvfubXgsL2Z9beleETwSwnn 6VSDgfGiuDCPpm5uJkC1xpaRrFaYl9mdiouz1Jg6/OGQu18VAP/IUE8zEct4mwoOFiDgog 5xEtILHA8PzfFEiNYvLE4Qdti1L76tJc1sNKo07fABdavQW8fXYqkmM5lbyPofMnvQRs/z hkg876PS/pGrS4e9uJ9mgrl5vMzPkPLUT2uKLZOw6hCoBdGTcOW725T1kzPMgQ== 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 6A476274C for ; Thu, 21 Nov 2024 14:34:02 +0100 (CET) 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-Type: text/plain; charset=us-ascii 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+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: 6A476274C X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.54 X-Spam-Score: -6.54 X-TUID: j0sTxDYpAUKr * 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" -- 2.46.0