From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id pXk5Lm3rs2DzaQAAgWs5BA (envelope-from ) for ; Sun, 30 May 2021 21:45:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oE3QKG3rs2AnSAAA1q6Kng (envelope-from ) for ; Sun, 30 May 2021 19:45:49 +0000 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 694DD18EB4 for ; Sun, 30 May 2021 21:45:49 +0200 (CEST) Received: from localhost ([::1]:38974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnRNc-00068E-H6 for larch@yhetil.org; Sun, 30 May 2021 15:45:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnRLu-0003iJ-Hx for guix-patches@gnu.org; Sun, 30 May 2021 15:44:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnRLu-00034H-Ak for guix-patches@gnu.org; Sun, 30 May 2021 15:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnRLu-0003dm-8g for guix-patches@gnu.org; Sun, 30 May 2021 15:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48750] [PATCH 2/2] lint: Check for trailing whitespace in description. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 30 May 2021 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48750 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48750@debbugs.gnu.org Received: via spool by 48750-submit@debbugs.gnu.org id=B48750.162240378813924 (code B ref 48750); Sun, 30 May 2021 19:44:02 +0000 Received: (at 48750) by debbugs.gnu.org; 30 May 2021 19:43:08 +0000 Received: from localhost ([127.0.0.1]:60382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnRL2-0003cW-6A for submit@debbugs.gnu.org; Sun, 30 May 2021 15:43:08 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:46318 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnRKz-0003bu-FJ for 48750@debbugs.gnu.org; Sun, 30 May 2021 15:43:06 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1622403779; bh=MI3eL/24LsP/zExvoDka6O8lC17NY5Hrxd2zx145Axo=; h=From:To:Subject:In-Reply-To:References:Date; b=d0UhsyKE3knmROUlmm1yWPME53Pzd3i/7AXUkuVpULmylG9earKSk+021TURFtiXG weDV5gNqSwBdEgRFwbEAOGb9KMfIwsqTf6eB+2j28auuKnLe3KO8lfHLn9YMknyxfp jPPq8fVw9Wwb1tFdIdU53L8fqvYr6gsu1qlCJh1k= In-Reply-To: References: Message-Id: <7f6526ca35091658589205efeb9f99f5e3a0c1e9.1622403325.git.public@yoctocell.xyz> Date: Sun, 30 May 2021 21:42:59 +0200 MIME-Version: 1.0 Content-Type: text/plain 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622403949; 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=XtPMts2TXLt/aCzpE7MFD+zIpx0gnZItT+m3FW7Ve90=; b=Y+6yEyEz5e/ccL6JPez5iuU6r9MNWvZfLnr8DGgYHyQwwg+uXd/xnsiMuiMB3TbdS6bCiq v/WROViX3gIaxvN3zdTEn2svrQaDxDvgvRVmk7XZBZLfdJI+22cV8y+DqvL0oKa4JVlRVk LeRGarxO+WqYQj1XB9tCpWLyOoeX/69yAQ8aQfSBLQPUSTdgIh3CFxiKLHP3hTpXb70ifi XEIxavUfqGUcVA8seJpk/Pq6ztZTFVoQx+jn1SCCXgxSsVppE2K/E6lD6Smi0mDOnfDFex ULXVOo5wHBQ7HtQerQNuti9wGIRM4pnhpBrQGUKr7mGC1qW7ZCHkwQc+cpxqrQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622403949; a=rsa-sha256; cv=none; b=kklkSs1H8WuCXg+KEzOacsGmW+Jki5ENR5Hm/skB0pJBDcmwu/BvLu7zMgWLl2goH9qti3 9hjOovsxmaSh/NwI/ZopPg7DUGYUdzzJYJZHP7ldyLZyCrZgmXaKpY3J06L6SXc8/9nWiY W/0UYY8lyvVmr1wJKb9d5D3aDKzpnZZIMn7OKRz2Q+4lfy6lzh3L9BXnZVLJ6P+95tTpxB Du4jAtA5ovvJ5HaJ5WyInmei/nU8WAAM3/rQbsP4rLdkPwfd0rE6i0zhG4vosj3Zxo9uP8 X9EbXyaAwMCvjZ9a55exuZAD3GHQY1y1svkmecQJb72UbChr0qNOhOecUlh6/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=d0UhsyKE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=d0UhsyKE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 694DD18EB4 X-Spam-Score: -0.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: lgozI2jwouCK * guix/lint.scm (check-description-style): Check for trailing whitespace. * tests/lint.scm: ("description: trailing whitespace"): New test. --- guix/lint.scm | 10 ++++++++++ tests/lint.scm | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/guix/lint.scm b/guix/lint.scm index d2ef4f34b2..4fdebc0aff 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -278,6 +278,15 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") infractions) #:field 'description))))) + (define (check-no-trailing-whitespace DESCRIPTION) + "Check that DESCRIPTION doesn't have trailing whitespace." + (if (string-suffix? " " description) + (list + (make-warning package + (G_ "description contains trailing whitespace") + #:field 'description)) + '())) + (let ((description (package-description package))) (if (string? description) (append @@ -287,6 +296,7 @@ by two spaces; possible infraction~p at ~{~a~^, ~}") ;; Use raw description for this because Texinfo rendering ;; automatically fixes end of sentence space. (check-end-of-sentence-space description) + (check-no-trailing-whitespace) (match (check-texinfo-markup description) ((and warning (? lint-warning?)) (list warning)) (plain-description diff --git a/tests/lint.scm b/tests/lint.scm index dddbf0679f..5c1e9d3db2 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -160,6 +160,13 @@ (description "This is a 'quoted' thing.")))) (check-description-style pkg)))) +(test-equal "description: trailing whitespace" + "description contains trailing whitespace" + (single-lint-warning-message + (let ((pkgs (dummy-package "x" + (description "Whitespace. ")))) + (check-description-style pkg)))) + (test-equal "synopsis: not a string" "invalid synopsis: #f" (single-lint-warning-message -- 2.31.1