From patchwork Tue Feb 28 06:18:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 18319 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 221EEBE08A for ; Tue, 28 Feb 2023 06:19:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5F1C162691; Tue, 28 Feb 2023 07:19:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677565155; bh=MQ/UeqjxbmUpMFUezVmW9Nl5eo6GyvFmt76vQ20c9M0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JMV1Br7ndeo1mV0ZT+EaJkXSQExHnhGtmXY5IAaVxEIzydx3JNGSQmdcftwbMZspT yaarJErsDg9SP66UDvFkJMUCyGZahtlweEmxDv2h0iHN7cceeMoiE2aydD/oIUKFQG jlbyJl02dd7P12KHtHl/BHGFlhTeTO+hwExr23X7gxsL6UvJcUQNXYF582slMNU45I xpGQkhK3mW9b+LVXDjJ9+R3f7Al6oDa6Mb3ofrMVJl1T1HkK6qtiiaovM1aZdGQDAq 1Qov6cmMRrTC9brgQHq+R8fCks/7jRAAMpGcUdaplJUVAnFFzTsoGNimf5zbEKNASQ 2Wir9aPU8jI6w== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E46206265A for ; Tue, 28 Feb 2023 07:19:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="M9L/ZWJq"; 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 5334856A; Tue, 28 Feb 2023 07:19:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1677565153; bh=MQ/UeqjxbmUpMFUezVmW9Nl5eo6GyvFmt76vQ20c9M0=; h=From:To:Cc:Subject:Date:From; b=M9L/ZWJqH1r78YLDmOYniwQLeXTRsbkp2u89QbKn1bdxEFT9JeCDBX4hp7UGuSJ1u W9v7gqUrRr6RB/9nYnYDA/C2Njh/3tMOp5F2xmD5yWW+vwvsOlXyyGzwvfWGJnvBO4 7+Xc7xtvEKPo87bo3KLTW4rZtGKhwdwQ+zzvtYx4= To: libcamera-devel@lists.libcamera.org Date: Tue, 28 Feb 2023 15:18:59 +0900 Message-Id: <20230228061859.2957748-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] 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 Reviewed-by: Laurent Pinchart --- utils/checkstyle.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 78645410..eb62e4ab 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 isinstance(commit, StagedChanges): + return [] + # Ignore release commits, they don't need a prefix. if TitleChecker.release_regex.fullmatch(title): return []