Patch Detail
Show a patch.
GET /api/1.1/patches/20168/?format=api
{ "id": 20168, "url": "https://patchwork.libcamera.org/api/1.1/patches/20168/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20168/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240531121838.27643-4-laurent.pinchart@ideasonboard.com>", "date": "2024-05-31T12:18:37", "name": "[3/4] utils: checkstyle.py: Add a check for hex values", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "0924fafbbe4b44eeb71479b1f89d5bd5cc01b67e", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20168/mbox/", "series": [ { "id": 4346, "url": "https://patchwork.libcamera.org/api/1.1/series/4346/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4346", "date": "2024-05-31T12:18:34", "name": "utils: checkstyle.py: Miscellaneous improvements", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4346/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20168/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20168/checks/", "tags": {}, "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 16293BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 May 2024 12:19:02 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26665634BB;\n\tFri, 31 May 2024 14:19:01 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 71458634B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 May 2024 14:18:56 +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 78A3611A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 May 2024 14:18:51 +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=\"nJmGtGAJ\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717157931;\n\tbh=/grH61Oa58Xd/XOJhnfvS+wRUgiDdZb2p+iyyZJZDyU=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=nJmGtGAJrqQV7VczXjdwbKnsrPhhc6eDBuUAbfmQZ9Z9paiQ3rW6218AFwnusCCid\n\tykOa/2KWbJ/X6gxWLXwqEl3YLZd448OBoD3kX8a29a+FywpyFCptFpJo/svZza3V/u\n\tIs603j9kBowGp0qv7CyxDnVACQbsXO5Z8QsVV/fM=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH 3/4] utils: checkstyle.py: Add a check for hex values", "Date": "Fri, 31 May 2024 15:18:37 +0300", "Message-ID": "<20240531121838.27643-4-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.44.1", "In-Reply-To": "<20240531121838.27643-1-laurent.pinchart@ideasonboard.com>", "References": "<20240531121838.27643-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>" }, "content": "libcamera uses lowercase hex values. Add a corresponding checker.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/checkstyle.py | 28 ++++++++++++++++++++++++++++\n 1 file changed, 28 insertions(+)", "diff": "diff --git a/utils/checkstyle.py b/utils/checkstyle.py\nindex f3604299de94..77d6f39011c1 100755\n--- a/utils/checkstyle.py\n+++ b/utils/checkstyle.py\n@@ -562,6 +562,34 @@ class StyleIssue(object):\n self.msg = msg\n \n \n+class HexValueChecker(StyleChecker):\n+ patterns = ('*.c', '*.cpp', '*.h')\n+\n+ regex = re.compile(r'\\b0[xX][0-9a-fA-F]+\\b')\n+\n+ def __init__(self, content):\n+ super().__init__()\n+ self.__content = content\n+\n+ def check(self, line_numbers):\n+ issues = []\n+\n+ for line_number in line_numbers:\n+ line = self.__content[line_number - 1]\n+ match = HexValueChecker.regex.search(line)\n+ if not match:\n+ continue\n+\n+ value = match.group(0)\n+ if value == value.lower():\n+ continue\n+\n+ issues.append(StyleIssue(line_number, line,\n+ f'Use lowercase hex constant {value.lower()}'))\n+\n+ return issues\n+\n+\n class IncludeChecker(StyleChecker):\n patterns = ('*.cpp', '*.h')\n \n", "prefixes": [ "3/4" ] }