From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4Dy0LqA2Tme/FAAAqHPOHw:P1 (envelope-from ) for ; Mon, 02 Dec 2024 22:37:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4Dy0LqA2Tme/FAAAqHPOHw (envelope-from ) for ; Mon, 02 Dec 2024 23:37:20 +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=mAGuRp2y; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733179040; 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=bng5SkhU7D9p8yIVTjwLiKL5oHAq06xwTCkedc55U3U=; b=QrVe0Sn6+cXWOzNLDD1WvSowzpQIxTdE8ojeZSouwv7fwY0UZlo5MwQx45gTiU7LL1D01+ y8A7KihY9gOWr9TZx+rue0Z6TP9yli1kENEd7GGP69UgjHvHF5Dtz53V+WS+j9i+Ne5qP1 Nz99w8Po2yKSHpmAI9FoqrAkizuRKPTV2gNrVIab5gi9ThCq7Ybgtnxuf2eRe6iaWyRKZU 1MAZuvk+VXdqd6RZz8vCgdHMYkoSJmbg2uXUcgrQ2ml7Kps9FfKQ2OpJ2MSFeirHT6h88y lHJ3dp07ZmqF1NVCaxA0F8r4z27JocXmnKb5ph5FZTaW5/mscn311gtxRz5Nrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=mAGuRp2y; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733179040; a=rsa-sha256; cv=none; b=WNwfX0J37qN5BomM55EPQ3Y3kUq4hkmmeZHxfRhzlmtt9CH/uOGOTy7aAmL6I3QkRx6O+C dbXyKKeW3tTEC031SQqo/F1m6HBO+ZZ4KOtl7qqJpPTP3VQybNvoAaL/0yo90cIB2jcBKY pU9GxsIVcNFK7pUUAu4gaCZ2XfqtGAHbknhv0f85BMt5Nr3ZzvM4KPIjYWj3HC7OUeB+Cf yKP78rcNOG+WZtWtPjqB+ayqp7VGQ5qyWZNspVU0ldDeOmMK/YqH2Oy7PTXAndv9BoigZX IHY00OAfckf56XKphhBPOW1QB99JAGVNpDdg4t2I6VoxfoDopv58UhBvoggyJQ== 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 73E828904A for ; Mon, 02 Dec 2024 23:37:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIF2V-0007ZI-Su; Mon, 02 Dec 2024 17:37:12 -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 1tIF2T-0007Z3-Tk for guix-patches@gnu.org; Mon, 02 Dec 2024 17:37:09 -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 1tIF2M-0005qh-Gg for guix-patches@gnu.org; Mon, 02 Dec 2024 17:37:04 -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=bng5SkhU7D9p8yIVTjwLiKL5oHAq06xwTCkedc55U3U=; b=mAGuRp2yo2+R8d3WM2tfVsy8Jcft+9skq+FVVtJCNN8Ig94xO11014j/Tdy2u/vUj3bSMMOXGPfJaKKtzksFmZ2BetboYNngpFHMId60sENQ0d9H54ASCpEUEd2gBb2vnMcC8RODP/2IXo9tAZB6sS2tPGN7EeunqbVseSreP43/yFoSLXh9lEOCEeewN7fA1QqttWcMaWPWKO6cfmF1weuXLK35zB3p91xwJY6B5FsBulPtY4k1Z83ZEivKLg49ltGAIO0zfqTkYnsugiX6lWIsrtYElIVcHe28dr58LCkCOp6ePfxzYVBlUhViIlwAUIR+4nh3O13kAJFXYOtVlw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIF2M-000440-AN for guix-patches@gnu.org; Mon, 02 Dec 2024 17:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74459] [PATCH v2 3/7] 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: Mon, 02 Dec 2024 22:37: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.173317901815607 (code B ref 74459); Mon, 02 Dec 2024 22:37:02 +0000 Received: (at 74459) by debbugs.gnu.org; 2 Dec 2024 22:36:58 +0000 Received: from localhost ([127.0.0.1]:56872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIF2H-00043f-Ro for submit@debbugs.gnu.org; Mon, 02 Dec 2024 17:36:58 -0500 Received: from cotopaxi.ee.ethz.ch ([129.132.148.196]:58327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIF2F-00043H-PY for 74459@debbugs.gnu.org; Mon, 02 Dec 2024 17:36:56 -0500 Received: from localhost (antispam.ee.ethz.ch [129.132.2.16]) by cotopaxi.ee.ethz.ch (Postfix) with ESMTP id 6E0D71FFFF for <74459@debbugs.gnu.org>; Mon, 2 Dec 2024 23:36:50 +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 05Rtjs38Gr3C for <74459@debbugs.gnu.org>; Mon, 2 Dec 2024 23:36:49 +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>; Mon, 2 Dec 2024 23:36:49 +0100 (CET) Date: Mon, 2 Dec 2024 23:36:44 +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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -4.01 X-Spam-Score: -4.01 X-Migadu-Queue-Id: 73E828904A X-TUID: 9idZSBeqDy9x * 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 63d101ebf9..d6d48ad27c 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)) @@ -447,6 +450,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))) '() @@ -513,7 +517,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