From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0LLODXT2s2BYeAAAgWs5BA (envelope-from ) for ; Sun, 30 May 2021 22:32:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +NfCCHT2s2APIQAAbx9fmQ (envelope-from ) for ; Sun, 30 May 2021 20:32:52 +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 A59FF1A283 for ; Sun, 30 May 2021 22:32:51 +0200 (CEST) Received: from localhost ([::1]:36558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnS78-0001MR-AI for larch@yhetil.org; Sun, 30 May 2021 16:32:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnS6N-0001LQ-0z for guix-patches@gnu.org; Sun, 30 May 2021 16:32:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnS6L-0007Z9-Pf 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 1lnS6L-0004ot-LV for guix-patches@gnu.org; Sun, 30 May 2021 16:32: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 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.162240666618455 (code B ref 48750); Sun, 30 May 2021 20:32:01 +0000 Received: (at 48750) by debbugs.gnu.org; 30 May 2021 20:31:06 +0000 Received: from localhost ([127.0.0.1]:60441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnS5S-0004nZ-Dr 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]:47388 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnS5N-0004my-C1 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=1622406655; bh=CslEwfv8kXJtf2B78ZoxdcFHNNotN0arfhvVHFy29ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Sslaf/VrQ9IsOYUJRWtPhjuzlxltxqGk2uk7UtWFgtiXFFP/ZTzPncNsmDOmM+cz7 T4kWq3zoBGqkJcErJvD9+l0oAjVGWhPf92xQU/Mv8aM4U2PWEf/M9vBg+HxZXcYnzu 7CDOu1a2yf5ZZuDzrvvvUxugTGuaqqFHRK6IXei4= Date: Sun, 30 May 2021 22:30:31 +0200 Message-Id: <2263996fdbd5853d7c16ea5fade00f1e1c0a448d.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=1622406771; 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=vVEejV/L7ry7Im9TeyxJGCM3zJU/ukXlZudjjTbbE4c=; b=jd8swQF3IwwtuA76qisQJAOPEqBund9rOTMbEIvPs8GoIVqp4jPXzzQ2dasf+zgu7EqZTf IdaU5m+1HRAugkxCN8+tT0rRCeWKgOAbxebnxqyJNjRrGkXLuUKxObsiZKcuHxko3uA18d sxprr+m2IIMcGuyjywh9NRipM/MvzVhqdglaZFGxgl3Vmhtaq6aADQV7xUrHVlXiLqKUai CIq9Z/0CB7n8BWtysyTkwPLySjboQUVh0qzE+FZTPwXhkQSB/zn0Pzk4XABHRZYaUHZ+zP heo8xXrnCyqNaSH9m1JLNgUwRofR22Od8t+xLXS2dLkQgImhCy1dI4GIou6fbQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622406771; a=rsa-sha256; cv=none; b=SZCHBabkwfMCQpTMsKwJhMZ0D8BATeTBA1RlBMKWN3R8DVytDXKe5VKJmFTNdvlcAgbJ9K NIC5NbjgeLFMh8WvAHcEVXCTX4+eEsF17rcECv/jn96/ctFjpIyyI6zWVAzddLrD+MEjo3 qTLVE+Bdb5HpF0eKTU+USf6bF8Ozb+2a/I0Xst3R8Oq/9eTu6MORzovK+abLuBQLnH5RuZ /t6lg4TFjlcFapOrwju9yt7Stjo8Fs9EZm5x9SlCVK9xyM5ZX2qAMBZNYgiUNB/dNboyCe qg8MindWjckgXk3mzKzGLpC+X6Xe5AGAUWUyRlFyQiSlJhmlqYfsCoNHkmAV+w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b="Sslaf/Vr"; 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="Sslaf/Vr"; 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: A59FF1A283 X-Spam-Score: 3.67 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1nty1xq2ZRVP * 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 base-commit: cefa260fb42693b87545b1baab8cef9723827f80 -- 2.31.1