From patchwork Mon Feb 27 12:15:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 18310 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9CC4CBE08A for ; Mon, 27 Feb 2023 12:16:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EFD4D6265A; Mon, 27 Feb 2023 13:15:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677500160; bh=V8JUeRmaUY2Ov0MBBIS7ld1oi9MqwhFTB4vy1qYdh0s=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=rfSEp5JBAmVfjJl1mUYrJie0iv7Kj8a9dJLQ4TO51J0JIjxOthJB6YvBwj95WVlYV zDD/ZndUjA1W64ssmrf5ucWz3gERs1jVPZ+1DR4EOvbKSUiMqpxluKJs6HrjkYSZDs lFD4NX5CkK5AqPNg4jttjeqa4KCjwOtnkRTvYpy9SYMswnqAxp6EpRx0UwxU79TATd lzryJ5o27Th5UIm64X2NtNNy2kaqY3GJ7ib5GolI2DV1Wgz7G0zTexeJbWfkOfe4kx RDWHbyb2ju4f3axa5vj5zLQhV0MHemMcU9hg3ntTwTqahqXjafz3Ba3zMRPv/HKZkZ BiiZhSnq8GjTw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E923662636 for ; Mon, 27 Feb 2023 13:15:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lZ4USHUC"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 62D7F56A; Mon, 27 Feb 2023 13:15:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1677500157; bh=V8JUeRmaUY2Ov0MBBIS7ld1oi9MqwhFTB4vy1qYdh0s=; h=From:To:Cc:Subject:Date:From; b=lZ4USHUCiWFLn5bNK/zCJvf2D7EZvB0AHAOmDBQpiLPAJb64FyT6HHVrb7SUI48WB hi8GHmGeLM5MLKyaqVFRAi9OiK/BKRaMT6YVrmCp7X7tyMt6C2lC3LFDVvXMOSLAzV Xvl9bnxwKVg+1K6mb8x3Su0DolaIKzQ/rPsjwJT0= To: libcamera-devel@lists.libcamera.org Date: Mon, 27 Feb 2023 21:15:46 +0900 Message-Id: <20230227121546.3231835-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] utils: checkstyle.py: Don't run commit title checker on staged commits X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When creating a new commit, there is no title, so the title checker complains that the title isn't compliant and the commit cannot be created if checkstyle is run as a pre-commit hook. Fix this by skipping the title checker when run on staged changes. Signed-off-by: Paul Elder --- utils/checkstyle.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 78645410..84f0f50f 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -360,6 +360,9 @@ class TitleChecker(CommitChecker): def check(cls, commit, top_level): title = commit.title + if title == 'Staged changes': + return [] + # Ignore release commits, they don't need a prefix. if TitleChecker.release_regex.fullmatch(title): return []