[{"id":23187,"web_url":"https://patchwork.libcamera.org/comment/23187/","msgid":"<5cd9510c-5d7d-d01a-2467-e85445d13ae3@ideasonboard.com>","date":"2022-05-27T10:02:56","subject":"Re: [libcamera-devel] [PATCH 1/3] utils: checkstyle: Run the\n\tClangFormatter last","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nThank you for the patch.\n\nOn 5/26/22 13:00, Laurent Pinchart via libcamera-devel wrote:\n> The IncludeOrderFormatter will be extended with more formatting rules\n> that should be applied before clang-format gets run, as it will\n> influence its output.\n>\n> Add a priority mechanism for formatters, and give a negative priority to\n> the ClangFormatter to make it run last.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@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 835f2a9fcd71..66af96abd402 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -279,6 +279,8 @@ class ClassRegistry(type):\n>           newclass = super().__new__(cls, clsname, bases, attrs)\n>           if bases:\n>               bases[0].subclasses.append(newclass)\n> +            bases[0].subclasses.sort(key=lambda x: getattr(x, 'priority', 0),\n> +                                     reverse=True)\n\n\nMakes sense..\n\n>           return newclass\n>   \n>   \n> @@ -568,6 +570,7 @@ class Formatter(metaclass=ClassRegistry):\n>   \n>   class CLangFormatter(Formatter):\n\n\nCouldn't help with notice the \"L\" in CLangFormatter, is it intentional. \nAnyways not related to this patch so:\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n>       patterns = ('*.c', '*.cpp', '*.h')\n> +    priority = -1\n>   \n>       @classmethod\n>       def format(cls, filename, data):","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 40E9CBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 May 2022 10:03:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61753633A5;\n\tFri, 27 May 2022 12:03:00 +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 2D545633A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 May 2022 12:02:59 +0200 (CEST)","from [192.168.1.101] (unknown [90.164.63.43])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AFEA631A;\n\tFri, 27 May 2022 12:02:58 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653645780;\n\tbh=pTlWiesFcGLffBH7vdDwq270u/vOrU7y8DYCb8jweSo=;\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:\n\tFrom;\n\tb=a6arLVDhcBZtxYmmxXLmX4RsG5x14usfpzfJ5pFHYFNu/5bmSgzesPn/bFZK1VXll\n\tYir73WMCFrGPKe1OgDiM2c43JRdS4lbPBjmVg1b7mNDvMN6r+2vT+s+mMDaeTmVHii\n\tpzYTdEaP6gHxp66m+NK3M6HirT+3vR1HVh6F2v8dkHE6uPSoW5jXgpt/rERdLXN+Ad\n\tn1r3PlRDmrMEIAfuZWYsoIWuVc2dufITIJOlDOjYK/k/IFQuRiVMjHUnn/fVbrkw4Z\n\tAmezCDESIJRYLm1vE5kgwOnJXCQNOaOBTOw/mS4HAr5I//TjoJMn6kHcILC94UhHps\n\t8lWy3VjGai8LA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653645778;\n\tbh=pTlWiesFcGLffBH7vdDwq270u/vOrU7y8DYCb8jweSo=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=HrRESOHH2ndoNi/mp/txBNRQmyOc4imVawnotA7MqB8c6I93RLLeEDCuXCwu35VWV\n\tkChPdHbTTSqApZ3jo96OMCqjhgxtxZDS8X1R8CZbAI2KAETAhs5BrgeWI1vQiWcahC\n\tALN9kaZEHm4Pk5DSRBMb2PJUSJLMQLxt5sBH8SjQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"HrRESOHH\"; dkim-atps=neutral","Message-ID":"<5cd9510c-5d7d-d01a-2467-e85445d13ae3@ideasonboard.com>","Date":"Fri, 27 May 2022 12:02:56 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220526110009.13874-1-laurent.pinchart@ideasonboard.com>\n\t<20220526110009.13874-2-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220526110009.13874-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/3] utils: checkstyle: Run the\n\tClangFormatter last","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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23196,"web_url":"https://patchwork.libcamera.org/comment/23196/","msgid":"<YpCyjIJlQzGofr6+@pendragon.ideasonboard.com>","date":"2022-05-27T11:14:20","subject":"Re: [libcamera-devel] [PATCH 1/3] utils: checkstyle: Run the\n\tClangFormatter last","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nOn Fri, May 27, 2022 at 12:02:56PM +0200, Umang Jain wrote:\n> On 5/26/22 13:00, Laurent Pinchart via libcamera-devel wrote:\n> > The IncludeOrderFormatter will be extended with more formatting rules\n> > that should be applied before clang-format gets run, as it will\n> > influence its output.\n> >\n> > Add a priority mechanism for formatters, and give a negative priority to\n> > the ClangFormatter to make it run last.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@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 835f2a9fcd71..66af96abd402 100755\n> > --- a/utils/checkstyle.py\n> > +++ b/utils/checkstyle.py\n> > @@ -279,6 +279,8 @@ class ClassRegistry(type):\n> >           newclass = super().__new__(cls, clsname, bases, attrs)\n> >           if bases:\n> >               bases[0].subclasses.append(newclass)\n> > +            bases[0].subclasses.sort(key=lambda x: getattr(x, 'priority', 0),\n> > +                                     reverse=True)\n> \n> \n> Makes sense..\n> \n> >           return newclass\n> >   \n> >   \n> > @@ -568,6 +570,7 @@ class Formatter(metaclass=ClassRegistry):\n> >   \n> >   class CLangFormatter(Formatter):\n> \n> Couldn't help with notice the \"L\" in CLangFormatter, is it intentional. \n\nIndeed. I'm not sure it was intentional. I've updated the commit message\naccordingly.\n\n> Anyways not related to this patch so:\n> \n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> \n> >       patterns = ('*.c', '*.cpp', '*.h')\n> > +    priority = -1\n> >   \n> >       @classmethod\n> >       def format(cls, filename, data):","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 3C74ABD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 May 2022 11:14:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6B404633A5;\n\tFri, 27 May 2022 13:14:33 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD91D633A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 May 2022 13:14:31 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [46.183.103.8])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 82D2D31A;\n\tFri, 27 May 2022 13:14:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653650073;\n\tbh=AAdzAlP/RQUTqUmqAsCPRE3gPgJ33bMFresqkqRj5/A=;\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=GbvXs+xanWjbI/UYuaBox0GPzXReona93p9owQABdgMpIDG8StiSutRLkBA3+cbvt\n\tMWMX6REoaGSdB9kgij1K5fixkKZpaAypAsOjuKv4Sf4BPbC5Idm8j9pOfz1Rt4kjxc\n\tQmqzOnNMn3P9Wxnl7XMborE28I4uSzEEBTAMITg1QGZIZ/tiLm1WAWf3UiIpQkjY5f\n\tCFLZEr7iYo2mVgB640w564H9LYafqo1JCggzWLaetVZRqU+RLHo2oc+5Ez0UbrV62N\n\tASlKy9Aqtegmas4hxXfYR0OIfIlsKCr2VsUFzK2SHHRKr3tvL8ry1ko4tMlWvvNjcY\n\tXQ6gCBnesayqA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653650071;\n\tbh=AAdzAlP/RQUTqUmqAsCPRE3gPgJ33bMFresqkqRj5/A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QV+lPB77Evn1Z1ivYNAZSJ8V8BuIj5F3339kRpYN2flLjqeHUxJX/3N5C3DLNbvec\n\tIe/skdEjMh7CiDOH5t4BZR/zHWh/haRJx5uwTNHN2e17VjJCJRF+Xa+PD9Rtpz337X\n\tU/Gc/sJl8JIP8IXHqnMQfgpRE9OGspIXLSh20tfE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QV+lPB77\"; dkim-atps=neutral","Date":"Fri, 27 May 2022 14:14:20 +0300","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<YpCyjIJlQzGofr6+@pendragon.ideasonboard.com>","References":"<20220526110009.13874-1-laurent.pinchart@ideasonboard.com>\n\t<20220526110009.13874-2-laurent.pinchart@ideasonboard.com>\n\t<5cd9510c-5d7d-d01a-2467-e85445d13ae3@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<5cd9510c-5d7d-d01a-2467-e85445d13ae3@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/3] utils: checkstyle: Run the\n\tClangFormatter last","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>"}},{"id":23263,"web_url":"https://patchwork.libcamera.org/comment/23263/","msgid":"<20220531054643.GJ2630765@pyrite.rasen.tech>","date":"2022-05-31T05:46:43","subject":"Re: [libcamera-devel] [PATCH 1/3] utils: checkstyle: Run the\n\tClangFormatter last","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Laurent,\n\nOn Thu, May 26, 2022 at 02:00:07PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> The IncludeOrderFormatter will be extended with more formatting rules\n> that should be applied before clang-format gets run, as it will\n> influence its output.\n> \n> Add a priority mechanism for formatters, and give a negative priority to\n> the ClangFormatter to make it run last.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\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 835f2a9fcd71..66af96abd402 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -279,6 +279,8 @@ class ClassRegistry(type):\n>          newclass = super().__new__(cls, clsname, bases, attrs)\n>          if bases:\n>              bases[0].subclasses.append(newclass)\n> +            bases[0].subclasses.sort(key=lambda x: getattr(x, 'priority', 0),\n> +                                     reverse=True)\n>          return newclass\n>  \n>  \n> @@ -568,6 +570,7 @@ class Formatter(metaclass=ClassRegistry):\n>  \n>  class CLangFormatter(Formatter):\n>      patterns = ('*.c', '*.cpp', '*.h')\n> +    priority = -1\n>  \n>      @classmethod\n>      def format(cls, filename, data):","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 F2405BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 May 2022 05:46:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4DED1633A6;\n\tTue, 31 May 2022 07:46:54 +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 97BD76040A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 May 2022 07:46:52 +0200 (CEST)","from pyrite.rasen.tech (softbank036240126034.bbtec.net\n\t[36.240.126.34])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0D2B66F0;\n\tTue, 31 May 2022 07:46:50 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653976014;\n\tbh=1xio6KK62rWRl8MbrulNdWOVrK15WXLUh9q5lEY8FUY=;\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=hxP9dS/Xr0/DYytJQWuKgn+czLKMvnK4i6tRwCYRwh14UM1Ox4TaD/sEBiWTQGWX3\n\tivaXDoMEjqkkk0alKoRSO4FZQ808DC7rYtlVARuVv6k6XmGJGf7+63lZqYH05/kkEK\n\t6PIZD3Jn5a5HtasHaqNq0AZ43XcZiNaAvJe/r98BbkzYhJvcmRUkpXepDXiqSJrHTu\n\tHDez2QAg3WGRgDVVSQUtJIweoflrHYBGjSBsvGzaWMpCJpkyF3YD2JDD5r+IHerQsq\n\thPxoSpstUEjNXCoFk8tAIkMt5TKS0GiVsmD73ZZAwNuorbrRzj07UGw52G89bN6A8t\n\tkZM12tTSzlIgA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653976012;\n\tbh=1xio6KK62rWRl8MbrulNdWOVrK15WXLUh9q5lEY8FUY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Nv6gVrJBDgi9OzhAPPiVzLbrzAG7+dQeG0KJllvC756xbQU7QwyztoZRm1neNQoAC\n\tCIZKEDi3fwSmJwmkQOl/U6zbthMOK6RIme9DA3o3tJu6gN9obGfu5iu5axq6Cgo9u5\n\tQ7WKrNzK/BFGhl7Az5ovMxymobgkSeG+fXhXL18I="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Nv6gVrJB\"; dkim-atps=neutral","Date":"Tue, 31 May 2022 14:46:43 +0900","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220531054643.GJ2630765@pyrite.rasen.tech>","References":"<20220526110009.13874-1-laurent.pinchart@ideasonboard.com>\n\t<20220526110009.13874-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20220526110009.13874-2-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/3] utils: checkstyle: Run the\n\tClangFormatter last","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":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"paul.elder@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>"}}]