[{"id":31084,"web_url":"https://patchwork.libcamera.org/comment/31084/","msgid":"<20240903182832.GB16183@pendragon.ideasonboard.com>","date":"2024-09-03T18:28:32","subject":"Re: [PATCH v2 2/2] utils: checkstyle: Remove style checker for\n\tpython pep8","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Stefan,\n\nThank you for the patch.\n\nOn Tue, Sep 03, 2024 at 06:10:55PM +0200, Stefan Klug wrote:\n> The issues detected and fixed by autopep8 are the same as the ones\n> detected by pycodestyle. As the formatter runs unconditionally we can\n> remove the checker.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  utils/checkstyle.py | 33 ---------------------------------\n>  1 file changed, 33 deletions(-)\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index 1ee211c3bb9b..ab89c0a14fab 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -709,39 +709,6 @@ class MesonChecker(StyleChecker):\n>          return issues\n>  \n>  \n> -class Pep8Checker(StyleChecker):\n> -    patterns = ('*.py',)\n> -    results_regex = re.compile(r'stdin:([0-9]+):([0-9]+)(.*)')\n> -\n> -    def __init__(self, content):\n> -        super().__init__()\n> -        self.__content = content\n> -\n> -    def check(self, line_numbers):\n> -        issues = []\n> -        data = ''.join(self.__content).encode('utf-8')\n> -\n> -        try:\n> -            ret = subprocess.run(['pycodestyle', '--ignore=E501', '-'],\n> -                                 input=data, stdout=subprocess.PIPE)\n> -        except FileNotFoundError:\n> -            issues.append(StyleIssue(0, None, None, 'Please install pycodestyle to validate python additions'))\n> -            return issues\n> -\n> -        results = ret.stdout.decode('utf-8').splitlines()\n> -        for item in results:\n> -            search = re.search(Pep8Checker.results_regex, item)\n> -            line_number = int(search.group(1))\n> -            position = int(search.group(2))\n> -            msg = search.group(3)\n> -\n> -            if line_number in line_numbers:\n> -                line = self.__content[line_number - 1]\n> -                issues.append(StyleIssue(line_number, None, line, msg))\n> -\n> -        return issues\n> -\n> -\n>  class ShellChecker(StyleChecker):\n>      patterns = ('*.sh',)\n>      results_line_regex = re.compile(r'In - line ([0-9]+):')","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 B885FBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 Sep 2024 18:29:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EFEDC634CB;\n\tTue,  3 Sep 2024 20:29:07 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F06B5634A6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 Sep 2024 20:29:05 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FFA7169;\n\tTue,  3 Sep 2024 20:27:53 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"B10fDGjs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725388073;\n\tbh=fwAdsfF08qKoGuxdD3fXJTS1hJ9u1JBUvPG1yLE6Z4g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=B10fDGjskUfutm61BiGmsQHY7fBBRlZctIOuWQeVqkEcQCcVhNdTSYSxKXCeI7V9N\n\tz8gpDoOPSFrMgAZqv0yfjsWBy7WDo7MtBwksLR9KkFMpe3/ott46G220OG1oI43pjl\n\tk0I9xcyulWpcSVcBGDkTjYHkkR8LGa2B57QX+wBE=","Date":"Tue, 3 Sep 2024 21:28:32 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 2/2] utils: checkstyle: Remove style checker for\n\tpython pep8","Message-ID":"<20240903182832.GB16183@pendragon.ideasonboard.com>","References":"<20240903161059.246075-1-stefan.klug@ideasonboard.com>\n\t<20240903161059.246075-3-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240903161059.246075-3-stefan.klug@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31086,"web_url":"https://patchwork.libcamera.org/comment/31086/","msgid":"<172544396007.129190.14241003902888467409@ping.linuxembedded.co.uk>","date":"2024-09-04T09:59:20","subject":"Re: [PATCH v2 2/2] utils: checkstyle: Remove style checker for\n\tpython pep8","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2024-09-03 17:10:55)\n> The issues detected and fixed by autopep8 are the same as the ones\n> detected by pycodestyle. As the formatter runs unconditionally we can\n> remove the checker.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  utils/checkstyle.py | 33 ---------------------------------\n>  1 file changed, 33 deletions(-)\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index 1ee211c3bb9b..ab89c0a14fab 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -709,39 +709,6 @@ class MesonChecker(StyleChecker):\n>          return issues\n>  \n>  \n> -class Pep8Checker(StyleChecker):\n> -    patterns = ('*.py',)\n> -    results_regex = re.compile(r'stdin:([0-9]+):([0-9]+)(.*)')\n> -\n> -    def __init__(self, content):\n> -        super().__init__()\n> -        self.__content = content\n> -\n> -    def check(self, line_numbers):\n> -        issues = []\n> -        data = ''.join(self.__content).encode('utf-8')\n> -\n> -        try:\n> -            ret = subprocess.run(['pycodestyle', '--ignore=E501', '-'],\n> -                                 input=data, stdout=subprocess.PIPE)\n> -        except FileNotFoundError:\n> -            issues.append(StyleIssue(0, None, None, 'Please install pycodestyle to validate python additions'))\n> -            return issues\n> -\n> -        results = ret.stdout.decode('utf-8').splitlines()\n> -        for item in results:\n> -            search = re.search(Pep8Checker.results_regex, item)\n> -            line_number = int(search.group(1))\n> -            position = int(search.group(2))\n> -            msg = search.group(3)\n> -\n> -            if line_number in line_numbers:\n> -                line = self.__content[line_number - 1]\n> -                issues.append(StyleIssue(line_number, None, line, msg))\n\nI like how the formatter is so much simpler as it's all just 'handled'.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> -\n> -        return issues\n> -\n> -\n>  class ShellChecker(StyleChecker):\n>      patterns = ('*.sh',)\n>      results_line_regex = re.compile(r'In - line ([0-9]+):')\n> -- \n> 2.43.0\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 E853CBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 Sep 2024 09:59:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A2FC634CB;\n\tWed,  4 Sep 2024 11:59:24 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A20D46341E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Sep 2024 11:59:22 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DDD42E3;\n\tWed,  4 Sep 2024 11:58:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sRk2CVrg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725443890;\n\tbh=cWxhuccwB0x9MSBlPKcOJhIW01pIMLu/csUj89ECcas=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=sRk2CVrgQipqupb4eXuu201bNgdZJGpgQUKUNXRQjyLA/WChSTZWTin+1Ajpn5PQE\n\tpqzhmAInZvqBvdJ75tlKqcPFtwHe6WdtRYgyHxJzXa8YhhO/nXWkEqGwowpsqHuAQd\n\tl5sN6f4ff4q3mI/5qs1ccbNH192uUwndZlu7KWH8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240903161059.246075-3-stefan.klug@ideasonboard.com>","References":"<20240903161059.246075-1-stefan.klug@ideasonboard.com>\n\t<20240903161059.246075-3-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 2/2] utils: checkstyle: Remove style checker for\n\tpython pep8","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 04 Sep 2024 10:59:20 +0100","Message-ID":"<172544396007.129190.14241003902888467409@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]