Show a patch.

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

{
    "id": 16061,
    "url": "https://patchwork.libcamera.org/api/patches/16061/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16061/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20220526110009.13874-3-laurent.pinchart@ideasonboard.com>",
    "date": "2022-05-26T11:00:08",
    "name": "[libcamera-devel,2/3] utils: checkstyle: Ensure \"...\" include style for internal headers",
    "commit_ref": "7a529a9e3525cef170d9b58d920e805f7ce0bbd2",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5cc8f54e6c7830f4d1933bd1c6769f1ca0010384",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16061/mbox/",
    "series": [
        {
            "id": 3142,
            "url": "https://patchwork.libcamera.org/api/series/3142/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3142",
            "date": "2022-05-26T11:00:06",
            "name": "libcamera: checkstyle: Improve header formatter",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3142/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16061/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16061/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 4A32BC326D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 May 2022 11:00:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 239B365665;\n\tThu, 26 May 2022 13:00:23 +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 F12F160418\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 May 2022 13:00:19 +0200 (CEST)",
            "from pendragon.lan (unknown [37.120.212.14])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8751F6D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 May 2022 13:00:19 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653562823;\n\tbh=MQH0YRTF3qDClE7iU422wz2lP3V+H8lW4am8/WGpPns=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Ye7HS8Z+qQVmvtaAv8YofLolzAUGGWevAGfuiuL1jdI3V/hiGIDspCLqQZY7moCO5\n\tFNbXWLLZCrciB5JKOmza/zwW3SfA7F8PngisKtmYH2CxXvExRD8wmUh0GrWPZ/VUsF\n\t2YUODfWqo28KV6274jU055fCmlx3JRzSEab3y1WkO/5387ifkBxxabcmgvoPVPNUvh\n\tcfufnLCe6gQZs7xPUaPV/Cw4Jr3hqz3i6LN3D2QpVv5h80e5vntqgpA5L58pckTTDI\n\t89KxbjIBtvDc9TJx7T9ANb/3xO7epvd9znHPToHOqev/CzJX5WpkZU9oRl42QPNnzo\n\timBKhXbChzS9A==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653562819;\n\tbh=MQH0YRTF3qDClE7iU422wz2lP3V+H8lW4am8/WGpPns=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=JUSi0hrLpDgrz0jenNWjdysHCxemSpx334ysLP7ib8QPL4Y8EBgNkQiUWyu6lIj7V\n\tuSxVTSX22CUxBp/BsS+a9wWLknkDvEqhv/glnGrU4/sAgvPMndQrDzG6YjdKiNFfkG\n\tJZc2QK0/eowzZFeCyVv1K3tjM9FRc3jU4Cp45m1c="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JUSi0hrL\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 26 May 2022 14:00:08 +0300",
        "Message-Id": "<20220526110009.13874-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220526110009.13874-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220526110009.13874-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/3] utils: checkstyle: Ensure \"...\"\n\tinclude style for internal headers",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "libcamera uses the \"...\" include style for internal headers. Enforce it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/checkstyle.py | 18 ++++++++++++++++--\n 1 file changed, 16 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/utils/checkstyle.py b/utils/checkstyle.py\nindex 66af96abd402..61783165bef2 100755\n--- a/utils/checkstyle.py\n+++ b/utils/checkstyle.py\n@@ -643,7 +643,7 @@ class DPointerFormatter(Formatter):\n class IncludeOrderFormatter(Formatter):\n     patterns = ('*.cpp', '*.h')\n \n-    include_regex = re.compile('^#include [\"<]([^\">]*)[\">]')\n+    include_regex = re.compile('^#include ([\"<])([^\">]*)([\">])')\n \n     @classmethod\n     def format(cls, filename, data):\n@@ -657,7 +657,21 @@ class IncludeOrderFormatter(Formatter):\n             if match:\n                 # If the current line is an #include statement, add it to the\n                 # includes group and continue to the next line.\n-                includes.append((line, match.group(1)))\n+                open_token = match.group(1)\n+                file_name = match.group(2)\n+                close_token = match.group(3)\n+\n+                # Ensure the \"...\" include style for internal headers and the\n+                # <...> style for all other libcamera headers.\n+                if (file_name.startswith('libcamera/internal')):\n+                    open_token = '\"'\n+                    close_token = '\"'\n+                elif (file_name.startswith('libcamera/')):\n+                    open_token = '<'\n+                    close_token = '>'\n+\n+                line = f'#include {open_token}{file_name}{close_token}'\n+                includes.append((line, file_name))\n                 continue\n \n             # The current line is not an #include statement, output the sorted\n",
    "prefixes": [
        "libcamera-devel",
        "2/3"
    ]
}