From nobody Tue May 13 15:58:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1538727141363221.09802621184883; Fri, 5 Oct 2018 01:12:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8309E30833AF; Fri, 5 Oct 2018 08:12:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 468845D9CA; Fri, 5 Oct 2018 08:12:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E2718180B5B7; Fri, 5 Oct 2018 08:12:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C7as009392 for ; Fri, 5 Oct 2018 04:12:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9777A5EDEF; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9000262470 for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 924AA8CDC for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S23; Fri, 05 Oct 2018 16:12:04 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:44 +0800 Message-Id: <20181005081145.29901-22-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S23 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRJYFAUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigRTWT1sfmGbEDQAAs- X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 214 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 21/22] build-aux:check-spacing: Add indicator to help correcting misaligned stuff X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 05 Oct 2018 08:12:20 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch definitely indicates the correct position for misaligned stuff. Signed-off-by: Shi Lei --- build-aux/check-spacing.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl index 64a5dac..478e7ab 100755 --- a/build-aux/check-spacing.pl +++ b/build-aux/check-spacing.pl @@ -277,11 +277,22 @@ sub CheckMisalignment { my $code =3D $$paren_stack[-1][2]; if ($pos !=3D length($`)) { my $pad =3D ""; + my $indicator =3D ""; if ($. > $linenum + 1) { $pad =3D " " x $pos . "...\n"; } print "Misaligned line in parenthesis:\n"; - print "$$file:$linenum-$.:\n$code$pad$$line\n"; + print "$$file:$linenum-$.:\n$code$pad$$line"; + if ($pos > length($`)) { + $indicator =3D " " x length($`); + $indicator .=3D "~" x ($pos - length($`)); + $indicator .=3D "^"; + } else { + $indicator =3D " " x $pos; + $indicator .=3D "^"; + $indicator .=3D "~" x (length($`) - $pos); + } + print "$indicator\n"; $ret =3D 1; } } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list