From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75CFBD2E5 for ; Fri, 15 Dec 2023 07:17:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sunshineco.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-67f0f7e379dso2842506d6.3 for ; Thu, 14 Dec 2023 23:17:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702624652; x=1703229452; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VJWbmONKBj4lmJh71eTftiIoFcBJ11hNU+oZvKNIq1Q=; b=KbbfDD/YJ/nxCKOohMSVAxfUHPKKR7TH7IROZpKxzSxDq/LjoQZrttIBllqBwbXLL8 Fj4T7ZwIOVBtw7bkPNtr7bWW31MpzCmof/h6GT4Us2vgmnlpRFo5W2obnDmtwjVrQHxD 1X6s2XWVY2sQt38JRt4dtkCEMBeHoiErAOD+iKgCzLMQnFLC7W/VlGK5TZgXsS/uNmI7 JqrAT+ny+j8E2eZ8woHLz4CL/ny1JvdAb096lPkHm2Q/jOmJk6pEoAU+S/mYAgBM4vXe UpaLJpvBwX1eVG8Y0MUp31pi1GJ++vhpHwAkzPtxbC8utqaH/jL+pkglN8xAzns7UzpK DEIw== X-Gm-Message-State: AOJu0YwDlXu+PJbM1OsK3DxtekJH5UJoVVby3Jgw56mAHwuTcwhf8+9D nHMtjef/HmQpvrSdwzoIe+sIIWsxMOgNLkjpMdo= X-Google-Smtp-Source: AGHT+IEaZ0NrAZz0XIp6YVx2OawHWWupcDQg8C7VQXXmrz3EcWKXED5q8fJ6v5BXFFq30M3Om6nrYKfKWufdRn4Dy3s= X-Received: by 2002:ad4:5343:0:b0:67a:a721:7825 with SMTP id v3-20020ad45343000000b0067aa7217825mr10053898qvs.74.1702624652326; Thu, 14 Dec 2023 23:17:32 -0800 (PST) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <4112adbe467c14a8f22a87ea41aa4705f8760cf6.1702380646.git.ps@pks.im> In-Reply-To: From: Eric Sunshine Date: Fri, 15 Dec 2023 02:17:20 -0500 Message-ID: Subject: Re: [PATCH v4] tests: adjust whitespace in chainlint expectations To: Patrick Steinhardt Cc: git@vger.kernel.org, Junio C Hamano Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2023 at 1:42=E2=80=AFAM Patrick Steinhardt wrot= e: > [...] > Instead of improving the detection logic, fix our ".expect" files so > that we do not need any post-processing at all anymore. This allows us > to drop the `-w` flag when diffing so that we can always use diff(1) > now. > > Note that we keep some of the post-processing of `chainlint.pl` output > intact to strip leading line numbers generated by the script. Having > these would cause a rippling effect whenever we add a new test that > sorts into the middle of existing tests and would require us to > renumerate all subsequent lines, which seems rather pointless. > > Signed-off-by: Patrick Steinhardt > --- > diff --git a/t/Makefile b/t/Makefile > @@ -103,20 +103,12 @@ check-chainlint: > for i in $(CHAINLINTTESTS); do \ > echo "# chainlint: $$i" && \ > - sed -e '/^[ ]*$$/d' chainlint/$$i.expect; \ > + cat chainlint/$$i.expect; \ > done \ > $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests | \ > - sed -e 's/^[1-9][0-9]* //;/^[ ]*$$/d' >'$(CHAINLINTTMP_= SQ)'/actual && \ > + sed -e 's/^[1-9][0-9]* //' >'$(CHAINLINTTMP_SQ)'/actual &= & \ > + diff -u '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual Thanks, this version looks fine. FWIW, you may consider this: Reviewed-by: Eric Sunshine Aside: I was rather surprised to see this output from git-am when applying = v4: Applying: tests: adjust whitespace in chainlint expectations .git/rebase-apply/patch:205: new blank line at EOF. + .git/rebase-apply/patch:219: new blank line at EOF. + warning: 2 lines add whitespace errors. But upon investigating the two "test" files in question, dqstring-line-splice.test and dqstring-no-interpolate.test, I recalled that I had to play tricks to escape the single-quote context created by the Makefile when generating t/chainlinttmp/tests in order to allow chainlint.pl to see a double-quoted string. So, the abovementioned blank lines are indeed expected output from chainlint.pl given the tricks played.