[{"id":26495,"web_url":"https://patchwork.libcamera.org/comment/26495/","msgid":"<Y/4DM1JTcFHxFgsH@pendragon.ideasonboard.com>","date":"2023-02-28T13:35:47","subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Don't run\n\tcommit title checker on staged commits","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Tue, Feb 28, 2023 at 03:18:59PM +0900, Paul Elder via libcamera-devel wrote:\n> When creating a new commit, there is no title, so the title checker\n> complains that the title isn't compliant and the commit cannot be\n> created if checkstyle is run as a pre-commit hook. Fix this by skipping\n> the title checker when run on staged changes.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  utils/checkstyle.py | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index 78645410..eb62e4ab 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -360,6 +360,9 @@ class TitleChecker(CommitChecker):\n>      def check(cls, commit, top_level):\n>          title = commit.title\n>  \n\nA comment here would be nice.\n\n        # Skip the check when validating staged changes (as done through a\n\t# pre-commit hook) as there is no title to check in that case.\n\nWith that,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +        if isinstance(commit, StagedChanges):\n> +            return []\n> +\n>          # Ignore release commits, they don't need a prefix.\n>          if TitleChecker.release_regex.fullmatch(title):\n>              return []","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C28F6BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Feb 2023 13:35:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05F6C6269D;\n\tTue, 28 Feb 2023 14:35:48 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6E7262671\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Feb 2023 14:35:46 +0100 (CET)","from pendragon.ideasonboard.com\n\t(153.162-64-87.adsl-dyn.isp.belgacom.be [87.64.162.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1C3A756A;\n\tTue, 28 Feb 2023 14:35:46 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1677591348;\n\tbh=zzi5yGxt5dY75wJqcG6lXVh5lQW/2KBSXeK4O2CprTc=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=rdF/84sCV3ZMLsWyUn272qS0AP2P+FoQ7CGbJwK1bj03sAhRzTpzzH7EsJvjgZXW8\n\tH2wC+j1jK2meaI/UcOPsZJVTN16kaqTBDOI28O0UegMhu7YhzEYT/6ywSdqMPGy06R\n\tmAVb8W8Sunc5VJT8Z75BTwdMS13juDgR55gwRQAa6XC7vGNZ0AEK/98B2C5+FCt3HQ\n\tyfz1iYIN+/82HrvgyBjaPcof3pVtTguvyEtt91xxtgHKerCIFdUSGU7Agp1Vfoy++V\n\tta9irqDlmpb8XAtZLiaG9G7Kh1FhwWbnAAhOUgNXqTBwgtKgofBBere5lqfvW+hU41\n\tCgtTWNTkhxLuw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1677591346;\n\tbh=zzi5yGxt5dY75wJqcG6lXVh5lQW/2KBSXeK4O2CprTc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=OiuKSEFvLgzNH2r3AnfDqS9k7sYgS/4N68Y4KciEr1SyXRK9mP7lrPsI7gY0+neGr\n\tglw6bUKTvvdsMlWyzjY9tA9HkS4zZv4HGrhJ3DEnRsPJ5F2dBwcFnfDrBOoLmjyghp\n\tPy55HBNimPk6g5/aCKzLs+jRL7bNlBkhRIC8cOx4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"OiuKSEFv\"; dkim-atps=neutral","Date":"Tue, 28 Feb 2023 15:35:47 +0200","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<Y/4DM1JTcFHxFgsH@pendragon.ideasonboard.com>","References":"<20230228061859.2957748-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230228061859.2957748-1-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2] utils: checkstyle.py: Don't run\n\tcommit title checker on staged commits","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]