[{"id":3344,"web_url":"https://patchwork.libcamera.org/comment/3344/","msgid":"<20200107155527.GC4871@pendragon.ideasonboard.com>","date":"2020-01-07T15:55:27","subject":"Re: [libcamera-devel] [PATCH 1/2] utils: checkstyle.py: Fix regex\n\tstring literal","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Tue, Jan 07, 2020 at 03:44:40PM +0000, Kieran Bingham wrote:\n> The checkstyle.py patch has a fault which it identified in itself when\n> updating the regex string.\n> \n>   --- utils/checkstyle.py\n>   +++ utils/checkstyle.py\n>   #105: : W605 invalid escape sequence '\\+'\n>   +    diff_header_regex = re.compile('@@ -([0-9]+)(,[0-9]+)? \\+([0-9]+)(,?[0-9]+)? @@')\n>   ---\n>   1 potential style issue detected, please review\n> \n> This is documented further at:\n>   https://www.flake8rules.com/rules/W605.html\n> \n> Update the string literal prefix to declare a raw byte string for the\n> regex parser.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  utils/checkstyle.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/checkstyle.py b/utils/checkstyle.py\n> index 335e58f5fddf..41cd3371e81e 100755\n> --- a/utils/checkstyle.py\n> +++ b/utils/checkstyle.py\n> @@ -102,7 +102,7 @@ class DiffHunkSide(object):\n>  \n>  \n>  class DiffHunk(object):\n> -    diff_header_regex = re.compile('@@ -([0-9]+),([0-9]+) \\+([0-9]+),([0-9]+) @@')\n> +    diff_header_regex = re.compile(r'@@ -([0-9]+),([0-9]+) \\+([0-9]+),([0-9]+) @@')\n>  \n>      def __init__(self, line):\n>          match = DiffHunk.diff_header_regex.match(line)","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 8E31760464\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jan 2020 16:55:39 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 956C052F;\n\tTue,  7 Jan 2020 16:55:38 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1578412539;\n\tbh=Z8DoU3VYCEIa8XQSc9u/rDLFAdW+0a/N3kDIU3UR0ks=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Mq39nOvyn7/hOta7FW3x+0xl58LXBx9h8MmNKt8EsiHFsFPZ+5l0ZQgP1AjoPaShE\n\trKSIiEXdpMSLC/E/RWIAIt9vuXAyvRF8QdV4P6dHzmBq0xCMx0j/NDfZrptXXpxhV6\n\tzaQICxVJtSZxFEz012q6Qz+kgJVYwLW/5llx+MPA=","Date":"Tue, 7 Jan 2020 17:55:27 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20200107155527.GC4871@pendragon.ideasonboard.com>","References":"<20200107154442.17372-1-kieran.bingham@ideasonboard.com>\n\t<20200107154442.17372-2-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200107154442.17372-2-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 1/2] utils: checkstyle.py: Fix regex\n\tstring literal","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>","X-List-Received-Date":"Tue, 07 Jan 2020 15:55:39 -0000"}}]