From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8I1hEW7rs2C0aAAAgWs5BA (envelope-from ) for ; Sun, 30 May 2021 21:45:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mFtuDG7rs2DtfwAAbx9fmQ (envelope-from ) for ; Sun, 30 May 2021 19:45:50 +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 EAE8018EB7 for ; Sun, 30 May 2021 21:45:49 +0200 (CEST) Received: from localhost ([::1]:39016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnRNd-0006A2-0h for larch@yhetil.org; Sun, 30 May 2021 15:45:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnRKw-00036F-JE for guix-patches@gnu.org; Sun, 30 May 2021 15:43:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnRKv-0002VH-Tb for guix-patches@gnu.org; Sun, 30 May 2021 15:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnRKv-0003c4-RW for guix-patches@gnu.org; Sun, 30 May 2021 15:43:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48750] [PATCH 1/2] lint: Check for trailing whitespace in synopsis. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 30 May 2021 19:43: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 Received: via spool by 48750-submit@debbugs.gnu.org id=B48750.162240376513863 (code B ref 48750); Sun, 30 May 2021 19:43:01 +0000 Received: (at 48750) by debbugs.gnu.org; 30 May 2021 19:42:45 +0000 Received: from localhost ([127.0.0.1]:60378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnRKe-0003bX-TU for submit@debbugs.gnu.org; Sun, 30 May 2021 15:42:45 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:46304 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnRKd-0003bL-Of for 48750@debbugs.gnu.org; Sun, 30 May 2021 15:42:44 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1622403758; bh=JdFH68gLYKts9C6/HGi5LqfW6UoeCYetIW5jLRpspkA=; h=From:To:Subject:In-Reply-To:References:Date; b=TXLnwRzNCLzpp9Kc73toxMxJ3dqvr0SI0W1ySWgWHjrtwy+RKt5ZsDNycqmd4/et6 Tu6gFdLnNSD/FR+yRswAapzJlwe1CDvlkPt/O+SHCR2iZ874ydo3xF9T3wh2hOxByE jtOvbrmrDBA3vBhYlrk26YYg755rhqd5g9ZCsnic= In-Reply-To: References: Message-Id: <2263996fdbd5853d7c16ea5fade00f1e1c0a448d.1622403325.git.public@yoctocell.xyz> Date: Sun, 30 May 2021 21:42:37 +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=1622403950; 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=0yrsDQBQO5D7WdUg/uvQjg6gnEt4wEGI4EaMuMkPMlI=; b=VrVJXXd4tZDhZ/fBIYLC8Q7Ta7/0kM/4UQzHQs2UeZJXQG3Z+WZmzM8wI+LiIco0qcS8oZ Uhpw6GBSncwTFxI9nYdIXSaxSHOwe0QQNlTuRoPAEbC9P4E+97z5WtFtOQjtMShRMi4l5Y sQyG/JoWYb2LYHOvrOTJxH4mC74viDMecQVe/PGm1XVY0lDTmO8mPtZX47En6a4WDfxUWX /a0mZybNCQwPawN0g1Gg+5D6VyDVIaG/ZWRbApMm1IIy7kgcbCIKWLpCg6JnOx5QEW8Gw0 vizFAnVALUJjXF5jcgXL498xKODPBSZwV2zwEJ8jT5l0oh6YXsRufPfBLcOEUQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622403950; a=rsa-sha256; cv=none; b=UrBOQDJ8FZldYrCUQWcg0DXRJ3G4lT5Q5yA5D352q6ksq+cIFMslJIXrFiLtJEXWw9hTfg /GZpae4naLWy0PjE4dtkq3czqqD4TSTbbq8NsUM9o9zEnW0zP3qW70ABD4StDqKCueONVM mv4Z7IPqTBHxrFMsfkGnGk4RlaHLuSV7MlP55BmVdw4T60g3bzVQozOny+N7dJmPbJG/mO irSJZQY11i7EKUwAyLQPS/0XZO2L2Z2M51bpnilp7bKfBRohabDi/YI/eN2K0YKdn6jbFs 9kQcU9FoH1dSTkrmf7MHYXKIVwQh2S7rn6GTRWJU9QHjrOGY3UQSKvwyP2eOWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=TXLnwRzN; 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=TXLnwRzN; 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: EAE8018EB7 X-Spam-Score: -0.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: jpEYQutnrkbq * guix/lint.scm (check-synopsis-style): Check for trailing whitespace. * tests/lint.scm ("synopsis: contains trailing whitespace"): New test. --- guix/lint.scm | 12 +++++++++++- tests/lint.scm | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/guix/lint.scm b/guix/lint.scm index a2d6418b85..d2ef4f34b2 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -456,13 +456,23 @@ markup is valid return a plain-text version of SYNOPSIS, otherwise #f." (G_ "Texinfo markup in synopsis is invalid") #:field 'synopsis))))) + (define (check-no-trailing-whitespace synopsis) + "Check that SYNOPSIS doesn't have trailing whitespace." + (if (string-suffix? " " synopsis) + (list + (make-warning package + (G_ "synopsis contains trailing whitespace") + #:field 'synopsis)) + '())) + (define checks (list check-proper-start check-final-period check-start-article check-start-with-package-name check-synopsis-length - check-texinfo-markup)) + check-texinfo-markup + check-no-trailing-whitespace)) (match (package-synopsis package) ("" diff --git a/tests/lint.scm b/tests/lint.scm index d54fafc1d2..dddbf0679f 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -271,6 +271,13 @@ (description "Imagine this is Taylor UUCP.")))) (check-synopsis-style pkg))) +(test-equal "synopsis: contains trailing whitespace" + "synopsis contains trailing whitespace" + (single-lint-warning-message + (let ((pkg (dummy-package "x" + (synopsis "Whitespace ")))) + (check-synopsis-style pkg)))) + (test-equal "name: use underscore in package name" "name should use hyphens instead of underscores" (single-lint-warning-message -- 2.31.1