From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kLDeDXv2s2A1fAAAgWs5BA (envelope-from ) for ; Sun, 30 May 2021 22:32:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CO4tCXv2s2DLZwAA1q6Kng (envelope-from ) for ; Sun, 30 May 2021 20:32:59 +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 5C9371AADC for ; Sun, 30 May 2021 22:32:58 +0200 (CEST) Received: from localhost ([::1]:36550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnS7F-0001Lh-7l for larch@yhetil.org; Sun, 30 May 2021 16:32:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnS6N-0001LR-7a for guix-patches@gnu.org; Sun, 30 May 2021 16:32:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnS6M-0007ZR-4N for guix-patches@gnu.org; Sun, 30 May 2021 16:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnS6M-0004p1-1a for guix-patches@gnu.org; Sun, 30 May 2021 16:32: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 20:32:01 +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 Cc: Xinglu Chen Received: via spool by 48750-submit@debbugs.gnu.org id=B48750.162240666718461 (code B ref 48750); Sun, 30 May 2021 20:32:01 +0000 Received: (at 48750) by debbugs.gnu.org; 30 May 2021 20:31:07 +0000 Received: from localhost ([127.0.0.1]:60443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnS5S-0004nc-L5 for submit@debbugs.gnu.org; Sun, 30 May 2021 16:31:06 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:47394 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnS5Q-0004n0-GG for 48750@debbugs.gnu.org; Sun, 30 May 2021 16:31:04 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1622406659; bh=a9H0dJGGJRRK8PBVjQO1An2TL4mqZ9LGIrTXFEnLL4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EVLA8Ogc7YX0BS298xjssQYGx2LmWU5RKtjaJVgNgFIxZhe152/XWcrxlYbVFFqx6 XAn/60OySEe73vKq8eOGPGz5wlmUhkumwh9OXrCBKDHeTaaSJEXOyvoU6p55iI9AHv H+bqR+0maCY5CJvh61/dktImH7S3wfpSJ/pmhtRc= Date: Sun, 30 May 2021 22:30:32 +0200 Message-Id: <03b2b2591e76a0bf55419c81c39e8f063b9b1d65.1622406578.git.public@yoctocell.xyz> In-Reply-To: References: MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622406778; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=abDAXhEAFWkN6Q8cYwgr9KumwaZDZDVfhbUhXzkBMPg=; b=HEQA++eCPw6G4nI+DxBQRnplFBDYesLW2H3QEflJ+AsTUSXA9IcKjBIyvLBDvQPB1yhaAB oS+xCnNr9cVnzLBWbHtxudGvoSSYuXL/hrfA/q5kHZjB8PalSOcwoxcveA6tvMcEs2sUz7 28x/ViGN/JVg9XyOYh7nJ0Ty79HteNZ6+CLcrcG6KkPn13FTFXEmf9wRtMoZud4BmBWmqg dj5fodZV/HLTF2KS02FDNtiBgs32bnFYMC55ATYbEl/C4MoAmUNetnXcw7cMHSYTdgaRTn H7V2v0cC68eDNQWTQBpKWQzAtStLFrU6c2K4CUli3TXj4Zc+IjfbIwEAvmehiw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622406778; a=rsa-sha256; cv=none; b=eBYbZDBbeg4+/4y/FAi4FuphwMwvReyogj8w3T7ORFoGVvxJ3fprbfFmWb4MF9L/bO3VJb ytcdnCicnMFfC65JfrRfe4G+ay7w8GFMD9Fzj/qqnIrulqtqx4ltEYlfKRBfYZVFf4/rQB P9VqqYNYkAT59nIaqgkzX0/Im5o8XnQe8R4mMe/u//uVa/kI6uKfg82p4segPYmtpe9vaa Ma7pONcm5GawZ7UYtrOu5iJwwoDv2WOXYp22e4fFQZncRvlnl6BZjXgTLj7cAf5opY2378 8i0JfuhDFAvwPDJD79iHZLU4RPi7abekG8sjFVJDClqY8YjizIG7sKMEMjRk2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=EVLA8Ogc; 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: 3.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=EVLA8Ogc; 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: 5C9371AADC X-Spam-Score: 3.67 X-Migadu-Scanner: scn1.migadu.com X-TUID: DbdgIunwuFu4 * 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..f4b601cf4f 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 description) (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..25615085df 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 ((pkg (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