Show a patch.

GET /api/1.1/patches/20167/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20167,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20167/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20167/",
    "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-3-laurent.pinchart@ideasonboard.com>",
    "date": "2024-05-31T12:18:36",
    "name": "[2/4] utils: checkstyle.py: Extend IncludeChecker to cover math.h",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0c51a628e10dfdc5d080ea9b01c109236aaf9715",
    "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/20167/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/20167/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20167/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 40DBBC32C8\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 May 2024 12:19:00 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A08EC634BF;\n\tFri, 31 May 2024 14:18:59 +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 1B8EF61A46\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 May 2024 14:18:55 +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 2294F11A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 May 2024 14:18:50 +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=\"pSYUZMUf\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717157930;\n\tbh=SUPECAxwvJDvRobZb/B9YJ9K3KpS0L2nzLsr6y8W1Wo=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=pSYUZMUf9nt60Izzy79OqQj/tByYrcjQTpUuGBj1fl/igC86FoaZHIb3N1vmor8N4\n\trJctmcABHjpq5ca3kYSAamt/9Q+uDWAOSbwyKHHgbLykQQ89H/XXVVaiQmn/Qr6efL\n\thBxLf5jfA12vXH1YKzaY6klB0DX7ixiMuSKwDtLs=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH 2/4] utils: checkstyle.py: Extend IncludeChecker to cover\n\tmath.h",
        "Date": "Fri, 31 May 2024 15:18:36 +0300",
        "Message-ID": "<20240531121838.27643-3-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": "math.h is an exception to the C compatibility header rule, as we prefer\nusing cmath. Extend the IncludeCheck to warn about it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/checkstyle.py | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/utils/checkstyle.py b/utils/checkstyle.py\nindex 518be0897db5..f3604299de94 100755\n--- a/utils/checkstyle.py\n+++ b/utils/checkstyle.py\n@@ -568,7 +568,7 @@ class IncludeChecker(StyleChecker):\n     headers = ('cassert', 'cctype', 'cerrno', 'cfenv', 'cfloat', 'cinttypes',\n                'climits', 'clocale', 'csetjmp', 'csignal', 'cstdarg', 'cstddef',\n                'cstdint', 'cstdio', 'cstdlib', 'cstring', 'ctime', 'cuchar',\n-               'cwchar', 'cwctype')\n+               'cwchar', 'cwctype', 'math.h')\n     include_regex = re.compile(r'^#include <([a-z.]*)>')\n \n     def __init__(self, content):\n@@ -588,9 +588,15 @@ class IncludeChecker(StyleChecker):\n             if header not in IncludeChecker.headers:\n                 continue\n \n-            header = header[1:] + '.h'\n+            if header.endswith('.h'):\n+                header_type = 'C++'\n+                header = 'c' + header[:-2]\n+            else:\n+                header_type = 'C compatibility'\n+                header = header[1:] + '.h'\n+\n             issues.append(StyleIssue(line_number, line,\n-                                     'C compatibility header <%s> is preferred' % header))\n+                                     f'{header_type} header <{header}> is preferred'))\n \n         return issues\n \n",
    "prefixes": [
        "2/4"
    ]
}