From nobody Tue Nov 26 14:22:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706609504; cv=none; d=zohomail.com; s=zohoarc; b=SgvquaU23oTxae1aBeBoHNRKJYcwsBy2tMgEAE5jnnqpDUPB3hkMh04rzp0YxITCvHdrnohE92mrZcckqFEKlBCOJsHqEFcJRF/UCePk6GD5upc8LLcqVY/U/p0uZnZHjwx059kDb+UiQ09UARRn6+nLbmQHKdG+LWsxXhy4ers= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706609504; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5EUAE0+fS+8pdEoClgBwkEwH6Z06aSX0F0hkIKyDRD0=; b=PEutdEN/vauRi8R5MAHzBMWxzuAsar2M0PMukC1qhtJExOnuGeMddpfJQZy/VeyA/wA0osGWUlQPbt1s+OCDmgqWFvguBXQw3gC15enDa5Hb+ED7L0Z+nHqe5t92Xcb/Gbo28bB/r3Loras08nmxwghWO9o7tn1Z13emvf8yjqE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706609504400549.7278015635576; Tue, 30 Jan 2024 02:11:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUl5W-0000ox-S3; Tue, 30 Jan 2024 05:11:30 -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 1rUl5U-0000kZ-UO for qemu-devel@nongnu.org; Tue, 30 Jan 2024 05:11:28 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUl5S-0004P8-8n for qemu-devel@nongnu.org; Tue, 30 Jan 2024 05:11:27 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e8fec0968so44792835e9.1 for ; Tue, 30 Jan 2024 02:11:24 -0800 (PST) Received: from localhost.localdomain (adsl-101.109.242.224.tellas.gr. [109.242.224.101]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b00337d5cd0d8asm10306010wrb.90.2024.01.30.02.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706609482; x=1707214282; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5EUAE0+fS+8pdEoClgBwkEwH6Z06aSX0F0hkIKyDRD0=; b=l1/NR3NGWADkPC2WyFcswLp0HVUgb5Bx4OIwz+G8f9S6vi+doQaGB4ts+1ay9a1quq uZxvTKuIe9fLLeO8vVX5nE/rDFCDlycDihyBrVCsW+Ub6yRdi+c+TwpuYmYpFlTo1qir W+OFhw/NpinFB2LUqKd+wTvfHL6ufp6vbDcR+KRTduozk2C/qevXKKQYFSQGovhydki8 raOHWCi3EL2v3ZRtCT2NL15Ho7LrXeDGz2B6ESZ0bktwJUQDhhoQ1MFTgmKtZO91PRYD YuUwXTj9CURSHkd1rVNqDTKwkZPR3Q5EAHPoGG1WMf122+cecKHeUie8kPrNniC4aD/d S2/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706609482; x=1707214282; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5EUAE0+fS+8pdEoClgBwkEwH6Z06aSX0F0hkIKyDRD0=; b=QqKu7HJCBvDmDTa+pw4SaBkE+FvC/JvwirZoyrFugZTuFJhsw4BS4ZBLJuHRbcf1Vv BXUqTsLZvSWjUAKb9ajwftHRZOWqBNuWxUOqfvehilFxbU4fL0WtsLEz7NQ9EGEHOpmn gC6qV40C1He72F5mHJWT1gSisMsLcDBmmPRk/nq6/+331e6RvWnt3cOzTfAikSQFRx2q WADVrsSRypdKb5aKf0t3a0w/Bc0tu1TBUBHHGAt6OVsbmqaRMQFsJ1feIHkaQ65JkuJb 8K9niFxIpBSCXB4PdjvAPR/LcMcBfwJnOnhprzzJeu3olKADYe0iY5huNyVScsUeVOEL qjbQ== X-Gm-Message-State: AOJu0YwWYxs6maSLm4uVo7LR5fjBUROy2pwnxUZG1y/hRJZug7aX1zmA jHecSBFSVLhmCNRqYR7r/gfeFzqmCJKEVB92CK9tV56MflPI+qoiHXoq8vqc7XgaTnUiqazhRSp UK1U= X-Google-Smtp-Source: AGHT+IGAeQrfCu9Yn0Nh7ilmryi3jGTNZzZaj/cOB38f82KA+fhXJYxDovzFQiJOgG/Yf+eR1nV0tQ== X-Received: by 2002:a5d:59a6:0:b0:33a:fdb8:c616 with SMTP id p6-20020a5d59a6000000b0033afdb8c616mr301592wrr.26.1706609482160; Tue, 30 Jan 2024 02:11:22 -0800 (PST) From: Manos Pitsidianakis To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Peter Maydell , Paolo Bonzini , Stefan Hajnoczi Subject: [PATCH v2] scripts/checkpatch.pl: check for placeholders in cover letter patches Date: Tue, 30 Jan 2024 12:11:07 +0200 Message-Id: <20240130101107.214872-1-manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=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: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706609506087100001 Content-Type: text/plain; charset="utf-8" Check if a file argument is a cover letter patch produced by git-format-patch --cover-letter; It is initialized with subject suffix " *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***". If they exist, warn the user. Signed-off-by: Manos Pitsidianakis --- Range-diff against v1: 1: 64b7ec2287 ! 1: 9bf816eb4c scripts/checkpatch.pl: check for placeholde= rs in cover letter patches @@ scripts/checkpatch.pl: sub process { +# --cover-letter; It is initialized with subject suffix +# " *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***" + if ($in_header_lines && -+ $rawline =3D~ /^Subject:.+[*]{3} SUBJECT HERE [*]{3}\s*$/) { -+ WARN("Patch appears to be a cover letter with uninitialized s= ubject" . -+ " '*** SUBJECT HERE ***'\n$hereline\n"); ++ $rawline =3D~ /^Subject:.+[*]{3} SUBJECT HERE [*]{3}\s*$/) { ++ WARN("Patch appears to be a cover letter with " . ++ "uninitialized subject '*** SUBJECT HERE ***'\n$hereline\n"); + } + + if ($rawline =3D~ /^[*]{3} BLURB HERE [*]{3}\s*$/) { -+ WARN("Patch appears to be a cover letter with leftover placeh= older " . -+ "text '*** BLURB HERE ***'\n$hereline\n"); ++ WARN("Patch appears to be a cover letter with " . ++ "leftover placeholder text '*** BLURB HERE ***'\n$hereline\n"); + } + if ($in_commit_log && $non_utf8_charset && $realfile =3D~ /^$/ && scripts/checkpatch.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7026895074..9a8d49f1d8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1650,6 +1650,20 @@ sub process { $non_utf8_charset =3D 1; } =20 +# Check if this is a cover letter patch produced by git-format-patch +# --cover-letter; It is initialized with subject suffix +# " *** SUBJECT HERE ***" and body prefix " *** BLURB HERE ***" + if ($in_header_lines && + $rawline =3D~ /^Subject:.+[*]{3} SUBJECT HERE [*]{3}\s*$/) { + WARN("Patch appears to be a cover letter with " . + "uninitialized subject '*** SUBJECT HERE ***'\n$hereline\n"); + } + + if ($rawline =3D~ /^[*]{3} BLURB HERE [*]{3}\s*$/) { + WARN("Patch appears to be a cover letter with " . + "leftover placeholder text '*** BLURB HERE ***'\n$hereline\n"); + } + if ($in_commit_log && $non_utf8_charset && $realfile =3D~ /^$/ && $rawline =3D~ /$NON_ASCII_UTF8/) { WARN("8-bit UTF-8 used in possible commit log\n" . $herecurr); base-commit: 11be70677c70fdccd452a3233653949b79e97908 --=20 =CE=B3=CE=B1=E1=BF=96=CE=B1 =CF=80=CF=85=CF=81=CE=AF =CE=BC=CE=B9=CF=87=CE= =B8=CE=AE=CF=84=CF=89