Show a patch.

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

{
    "id": 13268,
    "url": "https://patchwork.libcamera.org/api/patches/13268/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13268/",
    "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": "<20210809161425.1885984-1-kieran.bingham@ideasonboard.com>",
    "date": "2021-08-09T16:14:25",
    "name": "[libcamera-devel,v2] clang-format: Regroup sort orders",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "74db812e997d52580205c12dafb354c1597723ca",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13268/mbox/",
    "series": [
        {
            "id": 2324,
            "url": "https://patchwork.libcamera.org/api/series/2324/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2324",
            "date": "2021-08-09T16:14:25",
            "name": "[libcamera-devel,v2] clang-format: Regroup sort orders",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2324/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13268/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13268/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 33B00BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Aug 2021 16:14:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 96B636884F;\n\tMon,  9 Aug 2021 18:14:30 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 272EF60269\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Aug 2021 18:14:29 +0200 (CEST)",
            "from Monstersaurus.local\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B4E6A466;\n\tMon,  9 Aug 2021 18:14:28 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gHojTycH\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628525668;\n\tbh=/It9OcDXwR1pMOqaZdHbRyvBt27tX2iKv6Dg2lBhTvY=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=gHojTycHMZF3WmfHJBiAYzuCpzsqisij6MOclD+Pd37gePpmmcSmiCfQJMPP5cKCp\n\trOPfNcrvOQEk4DFU/rmhXSqVhuw1P1YhwUri04ZanYprZqKPTBUsQC9jLzrLa35/tR\n\tPvNjUgz5g+Tgi+R3SnJeiCdAyZ60kRwBpesy5RDQ=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Mon,  9 Aug 2021 17:14:25 +0100",
        "Message-Id": "<20210809161425.1885984-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] clang-format: Regroup sort orders",
        "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": "Utilise the clang-format header sort to provide a regex based pattern\nmatch for our header inclusion coding style.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nA sample of all headers from the project (+ a couple of extra tests)\nparsed through this can be seen at \n   https://paste.ubuntu.com/p/Bt87C6M77y/\n\nThis was generated by:\n git grep -h \"^#include\" | sort | uniq  > all-headers.cpp\n git add all-headers.cpp\n git commit all-headers.cpp -m \"Header Test\"\n ./utils/checkstyle.py | patch -p0\n\nWhile some false positives are visible in this list\n (for instance <camera_metadata_hidden.h> in c/system headers section)\nthis provides a great deal of the checks automatically, and the\nremaining cases may have to be spotted during review.\n\n .clang-format                  | 49 +++++++++++++++++++++++++++++++---\n Documentation/coding-style.rst | 20 +++++++++++---\n 2 files changed, 62 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/.clang-format b/.clang-format\nindex 3a8a896e373d..56cfbfa1bec4 100644\n--- a/.clang-format\n+++ b/.clang-format\n@@ -66,10 +66,53 @@ ExperimentalAutoDetectBinPacking: false\n FixNamespaceComments: true\n ForEachMacros:\n   - 'udev_list_entry_foreach'\n-IncludeBlocks: Preserve\n+SortIncludes: true\n+IncludeBlocks: Regroup\n IncludeCategories:\n-  - Regex: '.*'\n-    Priority: 1\n+  # Headers matching the name of the component are matched automatically.\n+  # Priority 1\n+  # Headers in <> with an extension. (+system libraries)\n+  - Regex:           '<([A-Za-z0-9\\-_])+\\.h>'\n+    Priority:        2 \n+  - Regex:           '<sys/.*>'\n+    Priority:        2\n+  # Qt includes (match before C++ standard library)\n+  - Regex:           '<Q([A-Za-z0-9\\-_])+>'\n+    Priority:        10\n+    CaseSensitive:   true\n+  # C++ standard library includes (no extension)\n+  - Regex:           '<([A-Za-z0-9\\-_/])+>'\n+    Priority:        3\n+  # Linux headers, as a second group/subset of system headers\n+  - Regex:           '<linux/.*>'\n+    Priority:        4\n+  # Headers for libcamera Base support\n+  - Regex:           '<libcamera/base/private.h>'\n+    Priority:        5\n+  - Regex:           '<libcamera/base/.*\\.h>'\n+    Priority:        6\n+  # Public API Headers for libcamera, which are not in a subdir (i.e. ipa/,internal/)\n+  - Regex:           '<libcamera/([A-Za-z0-9\\-_])+.h>'\n+    Priority:        7\n+  # IPA Interfaces\n+  - Regex:           '<libcamera/ipa/.*\\.h>'\n+    Priority:        8\n+  # libcamera Internal headers in \"\"  \n+  - Regex:           '\"libcamera/internal/.*\\.h\"'\n+    Priority:        9\n+  # Other libraries headers with one group per library (.h or .hpp)\n+  - Regex:           '<.*/.*\\.hp*>'\n+    Priority:        10\n+  # local modular includes \"path/file.h\" (.h or .hpp)\n+  - Regex:           '\"(.*/)+.*\\.hp*\"'\n+    Priority:        11\n+  # Other local headers \"file.h\" with extension (.h or .hpp)\n+  - Regex:           '\".*.hp*\"'\n+    Priority:        12\n+  # Any unmatched line, separated from the last group\n+  - Regex:\t     '\"*\"'\n+    Priority:        100\n+\n IncludeIsMainRegex: '(_test)?$'\n IndentCaseLabels: false\n IndentPPDirectives: None\ndiff --git a/Documentation/coding-style.rst b/Documentation/coding-style.rst\nindex 30c1778ed8bf..e4f1bb26024e 100644\n--- a/Documentation/coding-style.rst\n+++ b/Documentation/coding-style.rst\n@@ -70,19 +70,31 @@ macro. For .cpp files, if the file implements an API declared in a header file,\n that header file shall be included first in order to ensure it is\n self-contained.\n \n+While the following list is extensive, it documents the expected behaviour\n+defined by the clang-format configuraiton and tooling should assist with\n+ordering.\n+\n The headers shall be grouped and ordered as follows:\n \n 1. The header declaring the API being implemented (if any)\n-2. The C and C++ system and standard library headers\n-3. Other libraries' headers, with one group per library\n-4. Other project's headers\n+2. The C standard library and system headers\n+3. The C++ standard library headers\n+4. Linux kernel headers\n+5. The libcamera base private header if required\n+6. The libcamera base library headers\n+7. The libcamera public API headers\n+8. The libcamera IPA interfaces\n+9. The internal libcamera headers\n+10. Other libraries' headers, with one group per library\n+11. Local headers grouped by subdirectory\n+12. Any local headers\n \n Groups of headers shall be separated by a single blank line. Headers within\n each group shall be sorted alphabetically.\n \n System and library headers shall be included with angle brackets. Project\n headers shall be included with angle brackets for the libcamera public API\n-headers, and with double quotes for other libcamera headers.\n+headers, and with double quotes for internal libcamera headers.\n \n \n C++ Specific Rules\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}