[{"id":27539,"web_url":"https://patchwork.libcamera.org/comment/27539/","msgid":"<nbvgdwts7ixwntnzmha7u7nxn3gqyfnl6oxqdqrznznp53yakm@aa5xluch6sde>","date":"2023-07-11T14:32:16","subject":"Re: [libcamera-devel] [PATCH 0/4] utils: checkstyle.py: Fix Trailer\n\thandling","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Kieran\n\nOn Tue, Jul 11, 2023 at 02:39:11PM +0100, Kieran Bingham via libcamera-devel wrote:\n> Improve the handling of Trailer checking to support pre-commit hooks\n> which will run using the 'StagedChanges' and 'Amendment' commit types.\n>\n> While there are no trailers to parse for StagedChanges, the existing\n> trailers can be checked for Amendment commits. Update the code to\n> support this, and also remove a RuntimeError from the checker which can\n> be replaced with a usual CommitIssue instance.\n\nIt fixes the usage of checkstyle.py when used as pre-commit hook which\nused to fail as\n\nTraceback (most recent call last):\n  File \"libcamera.git/./utils/checkstyle.py\", line 1052, in <module>\n    sys.exit(main(sys.argv))\n             ^^^^^^^^^^^^^^\n  File \"libcamera.git/./utils/checkstyle.py\", line 1042, in main\n    issues += check_style(top_level, commit, args.checkers)\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"libcamera.git/./utils/checkstyle.py\", line 935, in check_style\n    for issue in checker.check(commit, top_level):\n                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"libcamera.git/./utils/checkstyle.py\", line 479, in check\n    for trailer in commit.trailers:\n                   ^^^^^^^^^^^^^^^\n  File \"libcamera.git/./utils/checkstyle.py\", line 239, in trailers\n    return self._trailers\n           ^^^^^^^^^^^^^^\nAttributeError: 'Amendment' object has no attribute '_trailers'. Did you mean: 'trailers'?\n\nTested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n>\n> Kieran Bingham (4):\n>   utils: checkstyle.py: Treat Malformed trailers as a CommitIssue\n>   utils: checkstyle.py: Initialise staged trailers\n>   utils: checkstyle.py: Derive Amendment from Commit\n>   utils: checkstyle.py: Check trailers for Amendment commits\n>\n>  utils/checkstyle.py | 36 +++++++++++++++++++++++++-----------\n>  1 file changed, 25 insertions(+), 11 deletions(-)\n>\n> --\n> 2.34.1\n>","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 EA247BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 11 Jul 2023 14:32:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D53F61E32;\n\tTue, 11 Jul 2023 16:32:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F87860570\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 11 Jul 2023 16:32:20 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8212949E;\n\tTue, 11 Jul 2023 16:31:31 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689085942;\n\tbh=8KjTwdhn9ya9wIRje6x/6xykkuoMIhxqBrEa+SCefjA=;\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=r7wOHwXcI9eudfWAz2tBOHebO+bIvZt0D6qRqh8QSCpRc0sOYchUXMpgeYniKY22V\n\tnhyvDWZwMZdW/jbUg0ck2FI7gGOMk76FhSLLNaq0HnTWduC0pwUQ4YiSDSFGxfDhst\n\tlaJSE2OAULADTDUZHVjaVIIfdXSEzHpEIjS320h6qQFUYe1trg37C8CKvzNj11AUac\n\tsu8sv/Pk4OaUtOJYeSP4dKDMF0ErqW3OAaiYzeuF4SCip9wsU2fHzeDaSIWssJirBK\n\tCsy54SivTVeArOpzptrc993jEtyuiJG0KXssVxiVwp4HPy5wRJR1CHblEEoUuBwmxS\n\t+onqSTSlNas9Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1689085891;\n\tbh=8KjTwdhn9ya9wIRje6x/6xykkuoMIhxqBrEa+SCefjA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=MaVYiYlcaZRKqmOfbUb1JYTsODvRj7nbccJ2IJ3fxYSyfiSn3+R+KyH3kPr/hvUwk\n\tAqJzIxogA8G4jLMC8f0D1oNoBw/bsben1Pke072e44QyS2fDpdSSCpmlZuJvp6Noh9\n\tSEgrR3ULJBvYStCuMJWZb1dZlb54VIjt3m3E+oW0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"MaVYiYlc\"; dkim-atps=neutral","Date":"Tue, 11 Jul 2023 16:32:16 +0200","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<nbvgdwts7ixwntnzmha7u7nxn3gqyfnl6oxqdqrznznp53yakm@aa5xluch6sde>","References":"<20230711133915.650485-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230711133915.650485-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/4] utils: checkstyle.py: Fix Trailer\n\thandling","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]