From patchwork Sat Nov 11 23:54:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 56359 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9769E27BBE2; Sat, 11 Nov 2023 23:56:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8061D27BBE9 for ; Sat, 11 Nov 2023 23:56:06 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1xpG-0006Lp-EJ; Sat, 11 Nov 2023 18:55:42 -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 1r1xpD-0006Lg-LR for guix-patches@gnu.org; Sat, 11 Nov 2023 18:55:39 -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 1r1xp1-0004p0-1f; Sat, 11 Nov 2023 18:55:38 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1xpa-0003ev-1Y; Sat, 11 Nov 2023 18:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67118] [PATCH] Change "tabulation" to "tabulation character" in linter & manual Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 11 Nov 2023 23:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67118@debbugs.gnu.org Cc: Ian Eure , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.169974694614027 (code B ref -1); Sat, 11 Nov 2023 23:56:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Nov 2023 23:55:46 +0000 Received: from localhost ([127.0.0.1]:54670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1xpJ-0003e9-8U for submit@debbugs.gnu.org; Sat, 11 Nov 2023 18:55:45 -0500 Received: from lists.gnu.org ([2001:470:142::17]:50126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1xpG-0003dn-1j for submit@debbugs.gnu.org; Sat, 11 Nov 2023 18:55:43 -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 1r1xoV-0006IO-6V for guix-patches@gnu.org; Sat, 11 Nov 2023 18:54:55 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1xoS-0004W6-VR for guix-patches@gnu.org; Sat, 11 Nov 2023 18:54:54 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 723FC32008C3; Sat, 11 Nov 2023 18:54:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 11 Nov 2023 18:54:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm2; t=1699746888; x= 1699833288; bh=TbHOL8mkLzXQjhtNXsiUVFFa+5OwSJhGXVMqHdWS/yg=; b=2 Ghm+m5LgJ74B6eifpKOeVunfOBLVngY7xInQfnOqx/we6yFSzWtUZdq/h6WjpFMl DyJGifHKmKaJZCFDpkL6P9V+pFBiTpZwUHCXrEy3/3jh6hV67gbZMQye6rY5L0+W r9EaoepyjhvfWl2T1YxqXDHeCn8KxZNN4Y4HsWNaVLlF849xiBkyT9yheZ80q8SD o460tkO4j9eGbrqLSWHdTW4mylgzpzzr3Xp8RGNlaHlkj1uYDRhUusSSXOy/pECD AV2XzZAm+Lnko8B95VV5zdL2R5M6LFWfHBJWchxV4ulMfDE0qABXz8BcDjzs7Lyc coIkXHQoK/p1qBwKkYOzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1699746888; x=1699833288; bh=T bHOL8mkLzXQjhtNXsiUVFFa+5OwSJhGXVMqHdWS/yg=; b=X5Dk+bYmRyotUwR+q JFWryy7npZwRoEo9+Uc8D8ZlESoXYXZjOte319ce2HS6m11ZDebiP3wtjCFDRtCO aQZwwmA6Ivh4ECauQ7dyCtCrdVdKT+EfTxxCKIi1P4YvYgBsleWjBJ3Qi9i1AXac sfzI+IrAAZ5DntMFgc0Uj5JYv70K1C3p9EJXrMUNWYPUtMFxLEhk4ikOw7wc75/0 iunh7wuL2awgDixdO5FQJajptDO4+mMc4TKcjMkxNLBJJvEocw3KAkrp/r+obIuU aJtxowD7ff+AFnr8Np4Q15K8Sdc6EwGr/I42Qjm65tf29AmoMMpTL1CHnTaPpYV9 TxjaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddviedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdludegmdenucfjughrpefhvf evufffkffogggtgfesthekredtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgr nhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpefgueekffejudfgvd evteelteeitdeuuddufffhuefhiefhjeetuefhgfettedvteenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhoshhpvggtrd htvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 11 Nov 2023 18:54:48 -0500 (EST) From: Ian Eure Date: Sat, 11 Nov 2023 15:54:32 -0800 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.19; envelope-from=ian@retrospec.tv; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches While linting my packages for my first contribution to Guix, I found this linter warning to be unclear. The linter looks for ASCII horizontal tab characters, but the message doesn’t make this clear, as it only says "tabulation." Tabulation is the aligning of text into tables, and this may be accomplished without using ASCII 0x09, for example, with spaces. This patch clarifies the message to specifically indicate the objectionable character, updates the test, and changes the language in the manual. Change-Id: I375d1aa0aec7dfab7e8dfaffb8d4ad0e4f330205 --- doc/guix.texi | 3 ++- guix/lint.scm | 19 ++++++++++--------- tests/lint.scm | 19 ++++++++++--------- 3 files changed, 22 insertions(+), 19 deletions(-) base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94 diff --git a/doc/guix.texi b/doc/guix.texi index 94903fb5e2..6396f129a1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -119,6 +119,7 @@ Copyright @copyright{} 2023 Zheng Junjie@* Copyright @copyright{} 2023 Brian Cully@* Copyright @copyright{} 2023 Felix Lechner@* +Copyright @copyright{} 2023 Ian Eure@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -15362,7 +15363,7 @@ Invoking guix lint @item formatting Warn about obvious source code formatting issues: trailing white space, -use of tabulations, etc. +use of ASCII tabulation characters, etc. @item input-labels Report old-style input labels that do not match the name of the diff --git a/guix/lint.scm b/guix/lint.scm index 861e352b93..f053716abf 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021-2023 Maxime Devos ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2023 Ian Eure ;;; ;;; This file is part of GNU Guix. ;;; @@ -348,17 +349,17 @@ (define (check-compiler-for-target package) (_ '()))) (parameterize ((%current-target-system "aarch64-linux-gnu")) (apply (lambda* (#:key (target 'not-set) - make-flags #:allow-other-keys) + make-flags #:allow-other-keys) (define make-flags/sexp (if (gexp? make-flags/sexp) (gexp->approximate-sexp make-flags) make-flags)) - ;; Some packages like 'tzdata' are never cross-compiled; - ;; the compilers are only used to build tools for - ;; compiling the rest of the package. - (if (eq? target '#false) - '() - (find-incorrect-compilers make-flags/sexp))) + ;; Some packages like 'tzdata' are never cross-compiled; + ;; the compilers are only used to build tools for + ;; compiling the rest of the package. + (if (eq? target '#false) + '() + (find-incorrect-compilers make-flags/sexp))) (package-arguments package)))) (define (properly-starts-sentence? s) @@ -1774,12 +1775,12 @@ (define (check-haskell-stackage package) ;;; (define (report-tabulations package line line-number) - "Warn about tabulations found in LINE." + "Warn about ASCII tabulation characters found in LINE." (match (string-index line #\tab) (#f #f) (index (make-warning package - (G_ "tabulation on line ~a, column ~a") + (G_ "tabulation character (0x09) on line ~a, column ~a") (list line-number index) #:location (location (package-file package) diff --git a/tests/lint.scm b/tests/lint.scm index a52a82237b..cec9e3ab21 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021, 2023 Maxime Devos +;;; Copyright © 2023 Ian Eure ;;; ;;; This file is part of GNU Guix. ;;; @@ -359,18 +360,18 @@ (define (warning-contains? str warnings) '() (check-compiler-for-target (dummy-package "x" - (arguments - (list #:make-flags - #~(list (string-append "CC=" (cc-for-target)))))))) + (arguments + (list #:make-flags + #~(list (string-append "CC=" (cc-for-target)))))))) (test-equal "compiler-for-target: CC=gcc is acceptable when target=#false" '() (check-compiler-for-target ;; This (dummy) package consists purely of architecture-independent data. (dummy-package "tzdata" - (arguments - (list #:target #false - #:make-flags #~(list "CC=gcc")))))) + (arguments + (list #:target #false + #:make-flags #~(list "CC=gcc")))))) ;; The emacs-build-system sets #:tests? #f by default. (test-equal "tests-true: #:tests? #t acceptable for emacs packages" @@ -1307,16 +1308,16 @@ (define (package-with-phase-changes changes) (test-assert "formatting: tabulation" (string-match-or-error - "tabulation on line [0-9]+, column [0-9]+" + "tabulation character \\(0x09\\) on line [0-9]+, column [0-9]+" (single-lint-warning-message - (check-formatting (dummy-package "leave the tab here: "))))) + (check-formatting (dummy-package "leave the tab here: "))))) (test-assert "formatting: trailing white space" (string-match-or-error "trailing white space .*" ;; Leave the trailing white space on the next line! (single-lint-warning-message - (check-formatting (dummy-package "x"))))) + (check-formatting (dummy-package "x"))))) (test-assert "formatting: long line" (string-match-or-error