Show a patch.

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

{
    "id": 10743,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10743/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10743/",
    "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": "<20201224122855.22200-8-laurent.pinchart@ideasonboard.com>",
    "date": "2020-12-24T12:28:54",
    "name": "[libcamera-devel,7/8] utils: checkstyle.py: Add commit checkers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4450553ab9ea86a734a57b8c94e04fe7c43b2d6a",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": {
        "id": 14,
        "url": "https://patchwork.libcamera.org/api/1.1/users/14/?format=api",
        "username": "pinchartl",
        "first_name": "Laurent",
        "last_name": "Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10743/mbox/",
    "series": [
        {
            "id": 1550,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1550/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1550",
            "date": "2020-12-24T12:28:47",
            "name": "checkstyle.py: Ensure meson.build is updated when adding header",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1550/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10743/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10743/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 CB076C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Dec 2020 12:29:16 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B22C62005;\n\tThu, 24 Dec 2020 13:29:16 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 50A82615AC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Dec 2020 13:29:10 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EB866DFC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Dec 2020 13:29:09 +0100 (CET)"
        ],
        "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=\"TB85nlZb\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1608812950;\n\tbh=LXq3q8vXJNF3MJqbcdQQ/ujxaZIqwAZYEuyeR+1e0AA=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=TB85nlZbVt1ga9hir0emhP3hFKax/2CQ4WecXJQ4vd9HK7ZFCyuc1vNn0YnbCXqi+\n\tVgESeXzWFTWCq/+wN2AaPQRoY9FwS7yMMXF1GWBueHVnAfSmfawz/LbEixJXabQH55\n\tGzftOKtzmFrqyMzlllkDhkB7HHlxLnU/ieJLiPg0=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 24 Dec 2020 14:28:54 +0200",
        "Message-Id": "<20201224122855.22200-8-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20201224122855.22200-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20201224122855.22200-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 7/8] utils: checkstyle.py: Add commit\n\tcheckers",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a new category of checkers that operate on a whole commit.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/checkstyle.py | 42 +++++++++++++++++++++++++++++++++++-------\n 1 file changed, 35 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/utils/checkstyle.py b/utils/checkstyle.py\nindex 9c2a1837aa11..c0a6b7ab06cd 100755\n--- a/utils/checkstyle.py\n+++ b/utils/checkstyle.py\n@@ -296,6 +296,30 @@ class ClassRegistry(type):\n         return newclass\n \n \n+# ------------------------------------------------------------------------------\n+# Commit Checkers\n+#\n+\n+class CommitChecker(metaclass=ClassRegistry):\n+    subclasses = []\n+\n+    def __init__(self):\n+        pass\n+\n+    #\n+    # Class methods\n+    #\n+    @classmethod\n+    def checkers(cls):\n+        for checker in cls.subclasses:\n+            yield checker\n+\n+\n+class CommitIssue(object):\n+    def __init__(self, msg):\n+        self.msg = msg\n+\n+\n # ------------------------------------------------------------------------------\n # Style Checkers\n #\n@@ -721,25 +745,29 @@ def check_style(top_level, commit):\n     print(commit.title)\n     print(separator)\n \n+    issues = 0\n+\n+    # Apply the commit checkers first.\n+    for checker in CommitChecker.checkers():\n+        for issue in checker.check(commit, top_level):\n+            print('%s%s%s' % (Colours.fg(Colours.Yellow), issue.msg, Colours.reset()))\n+            issues += 1\n+\n     # Filter out files we have no checker for.\n     patterns = set()\n     patterns.update(StyleChecker.all_patterns())\n     patterns.update(Formatter.all_patterns())\n     files = [f for f in commit.files() if len([p for p in patterns if fnmatch.fnmatch(os.path.basename(f), p)])]\n-    if len(files) == 0:\n-        print(\"Commit doesn't touch source files, skipping\")\n-        return 0\n \n-    issues = 0\n     for f in files:\n         issues += check_file(top_level, commit, f)\n \n     if issues == 0:\n-        print(\"No style issue detected\")\n+        print(\"No issue detected\")\n     else:\n         print('---')\n-        print(\"%u potential style %s detected, please review\" % \\\n-                (issues, 'issue' if issues == 1 else 'issues'))\n+        print(\"%u potential %s detected, please review\" %\n+              (issues, 'issue' if issues == 1 else 'issues'))\n \n     return issues\n \n",
    "prefixes": [
        "libcamera-devel",
        "7/8"
    ]
}