get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133635,
    "url": "https://patches.dpdk.org/api/patches/133635/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231030223238.65044-1-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20231030223238.65044-1-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231030223238.65044-1-stephen@networkplumber.org",
    "date": "2023-10-30T22:32:18",
    "name": "[v7] devtools: add script to check for non inclusive naming",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "32ef8e408bcd1c3ac05fea2a21c83f8e6945cfa1",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20231030223238.65044-1-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 30066,
            "url": "https://patches.dpdk.org/api/series/30066/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30066",
            "date": "2023-10-30T22:32:18",
            "name": "[v7] devtools: add script to check for non inclusive naming",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/30066/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/133635/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/133635/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1073643247;\n\tMon, 30 Oct 2023 23:32:44 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D5DA240266;\n\tMon, 30 Oct 2023 23:32:43 +0100 (CET)",
            "from mail-pg1-f181.google.com (mail-pg1-f181.google.com\n [209.85.215.181])\n by mails.dpdk.org (Postfix) with ESMTP id 2D70F40042\n for <dev@dpdk.org>; Mon, 30 Oct 2023 23:32:42 +0100 (CET)",
            "by mail-pg1-f181.google.com with SMTP id\n 41be03b00d2f7-5ab53b230f1so3481788a12.3\n for <dev@dpdk.org>; Mon, 30 Oct 2023 15:32:42 -0700 (PDT)",
            "from fedora.. ([38.142.2.14]) by smtp.gmail.com with ESMTPSA id\n b2-20020aa78702000000b006bd8f4e398csm24688pfo.135.2023.10.30.15.32.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 30 Oct 2023 15:32:40 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1698705161;\n x=1699309961; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=d9nWYeheqnHDpNLq0b1rzaQELAElmBs4UI9Pp3/iAkQ=;\n b=HhRNRveUqtRVgtdU2swAkZ3Tkf/DZEg6Sqnl02JL1wn3OtNEMGUlLdNwnFddqfgbB0\n bEjG9U9zTOftMauAiAGQSNu4dyWf9h2Se82C2a20j59FJzqalCfKhEFRhWxT/H+zgklB\n G1VgIJ2AGu1Q0xe+lfSg4YVkjWQUIgFTVCe6b3Wuv/FaYcGW2DJUOfW5FmO7l+2IfDH9\n KYVti5IQjcr8qtLKEsEFs29fQXIPunR6vjVQG9m5OJnBiu4SqiwrMpyntqM0ANCPPe01\n HOlEjA9fctx0SimMDFZir9TlgdrJ9H+gCTyzT5IamWelFHAC7JFqkDp3QYWZG01dE5+z\n pIbw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1698705161; x=1699309961;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=d9nWYeheqnHDpNLq0b1rzaQELAElmBs4UI9Pp3/iAkQ=;\n b=ZqqaMLCarPAkNWseED5z/1GRRyFeN6aDbV8z+sF8KOyG5wgDH6nolIb+V23N261qfZ\n miD2h7NhPQxie7NRJV2CrS509+tMOYKkJ2W/qzltgPLmCeFsosAsRX2wwM3XEGwjgfv+\n txEVjKaoT30L7O0aDCmG7AnrpiB3k9Jf1KQzGzXqgRMb9X1En04XzzZA+iI6UlDA4iOG\n 4x0ys+XgwEnCLinafv46hC8MimynfZALFLePnHHcBEaM5UpKPBU4qnTnRnlk/s/FxLaZ\n JSS+fs/wUOQM8dglqL5+wvJyrQAs0JDh+usjfJ3vkkJ/Hmfwk1wsy90DP/ICZmXwhPpy\n 6vuQ==",
        "X-Gm-Message-State": "AOJu0YyMSFMMHyOU7F5etjl2FWYhnbaQicm74AjqqND+eumRe4nAgEGe\n /dZaQ3HqBWL+sie1HtymSlfTRK0lhue/uY2BPSd8DzHZRt8=",
        "X-Google-Smtp-Source": "\n AGHT+IGdhUPZrncVmJFlb8XAZR/WhiA9adXyYqZRH+xv1ExqqmRANrEuGuvBJ9QVx1VE6a0v1Ul/Mw==",
        "X-Received": "by 2002:a05:6a20:8e0b:b0:14c:a53c:498c with SMTP id\n y11-20020a056a208e0b00b0014ca53c498cmr11122035pzj.10.1698705160874;\n Mon, 30 Oct 2023 15:32:40 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v7] devtools: add script to check for non inclusive naming",
        "Date": "Mon, 30 Oct 2023 15:32:18 -0700",
        "Message-ID": "<20231030223238.65044-1-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.41.0",
        "In-Reply-To": "<0230331200824.195294-1-stephen@networkplumber.org>",
        "References": "<0230331200824.195294-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Script to find words that should not be used. Really just a wrapper\naround git grep command.  By default it prints matches but\ncan also display counts.\n\nUses the word lists from Inclusive Naming Initiative\nsee https://inclusivenaming.org/word-lists/\n\nNote: the list has extra comma at end of list of elements which is not\nvalid in basic JSON but allowed in user-friendly JSON5\n(https://json5.org/) and therefore needs the PyPi package for parsing\njson5 format.\n\nExamples:\n$ ./devtools/check-naming-policy.sh -c\napp/test-compress-perf/comp_perf_test_cyclecount.c:1\nuapp/test-compress-perf/comp_perf_test_throughput.c:1\napp/test-compress-perf/comp_perf_test_verify.c:1\napp/test/test_common.c:1\n...\n\n$ ./devtools/check-naming-policy.py lib/pcapng\nlib/pcapng/rte_pcapng.c:                /* sanity check that is really a pcapng mbuf */\n\n$ ./devtools/check-naming-policy.py -l lib/eal\nlib/eal/common/eal_common_memory.c\nlib/eal/common/eal_common_proc.c\nlib/eal/common/eal_common_trace.c\nlib/eal/common/eal_memcfg.h\nlib/eal/common/rte_malloc.c\nlib/eal/freebsd/eal.c\nlib/eal/include/generic/rte_power_intrinsics.h\nlib/eal/include/generic/rte_rwlock.h\nlib/eal/include/generic/rte_spinlock.h\nlib/eal/include/rte_debug.h\nlib/eal/include/rte_seqlock.h\nlib/eal/linux/eal.c\nlib/eal/windows/eal.c\nlib/eal/x86/include/rte_rtm.h\nlib/eal/x86/include/rte_spinlock.h\nlib/eal/x86/rte_power_intrinsics.c\n\n$ ./devtools/check-inclusive-naming -h\nusage: check-inclusive-naming.py [-h] [-c] [-d] [-l] [-t {0,1,2,3}]\n                                 [-x EXCLUDE] [--url URL]\n                                 [paths ...]\n\nIdentify word usage not aligned with inclusive naming\n\npositional arguments:\n  paths                 files and directory to scan\n\noptions:\n  -h, --help            show this help message and exit\n  -c, --count           Show the number of lines that match\n  -d, --debug           Debug this script\n  -l, --files-with-matches\n                        Show only names of files with hits\n  -t {0,1,2,3}, --tier {0,1,2,3}\n                        Show non-conforming words of particular tier\n  -x EXCLUDE, --exclude EXCLUDE\n                        Exclude path from scan\n  --url URL             URL for the non-inclusive naming word list\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\nv7 - fix typos in commit log\n\n MAINTAINERS                        |   1 +\n devtools/check-inclusive-naming.py | 127 +++++++++++++++++++++++++++++\n 2 files changed, 128 insertions(+)\n create mode 100755 devtools/check-inclusive-naming.py",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 4083658697..b53600ff51 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -89,6 +89,7 @@ F: devtools/check-doc-vs-code.sh\n F: devtools/check-dup-includes.sh\n F: devtools/check-maintainers.sh\n F: devtools/check-forbidden-tokens.awk\n+F: devtools/check-inclusive-naming.py\n F: devtools/check-git-log.sh\n F: devtools/check-spdx-tag.sh\n F: devtools/check-symbol-change.sh\ndiff --git a/devtools/check-inclusive-naming.py b/devtools/check-inclusive-naming.py\nnew file mode 100755\nindex 0000000000..3d5cebf7b2\n--- /dev/null\n+++ b/devtools/check-inclusive-naming.py\n@@ -0,0 +1,127 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2023 Stephen Hemminger\n+#\n+# This script scans the source tree and creates list of files\n+# containing words that are recommended to be avoided by the\n+# Inclusive Naming Initiative.\n+# See: https://inclusivenaming.org/word-lists/\n+\n+import argparse\n+import subprocess\n+from urllib.request import urlopen\n+\n+# Need JSON5 to be able to handle extra comma\n+import json5\n+\n+naming_url = 'https://inclusivenaming.org/word-lists/index.json'\n+\n+# These give false positives\n+exception_list = [\n+    'doc/guides/rel_notes/',\n+    'doc/guides/contributing/coding_style.rst'\n+    'doc/guides/prog_guide/glossary.rst'\n+]\n+\n+\n+def args_parse():\n+    \"parse arguments and return the argument object back to main\"\n+\n+    parser = argparse.ArgumentParser(\n+        description=\"Identify word usage not aligned with inclusive naming\")\n+    parser.add_argument(\"-c\",\n+                        \"--count\",\n+                        help=\"Show the number of lines that match\",\n+                        action='store_true')\n+    parser.add_argument(\"-d\",\n+                        \"--debug\",\n+                        default=False,\n+                        help=\"Debug this script\",\n+                        action='store_true')\n+    parser.add_argument(\"-l\",\n+                        \"--files-with-matches\",\n+                        help=\"Show only names of files with hits\",\n+                        action='store_true')\n+    # note: tier 0 is \"ok to use\"\n+    parser.add_argument(\"-t\",\n+                        \"--tier\",\n+                        type=int,\n+                        choices=range(0, 4),\n+                        action='append',\n+                        help=\"Show non-conforming words of particular tier\")\n+    parser.add_argument('-x',\n+                        \"--exclude\",\n+                        default=exception_list,\n+                        action='append',\n+                        help=\"Exclude path from scan\")\n+    parser.add_argument('--url',\n+                        default=naming_url,\n+                        help=\"URL for the non-inclusive naming word list\")\n+    parser.add_argument('paths', nargs='*',\n+                        help='files and directory to scan')\n+\n+    return parser.parse_args()\n+\n+\n+def fetch_wordlist(url, tiers):\n+    \"Read list of words from inclusivenaming.org\"\n+\n+    # The wordlist is returned as JSON like:\n+    # {\n+    # \"data\" :\n+    #         [\n+    #             {\n+    #                 \"term\": \"abort\",\n+    #                 \"tier\" : \"1\",\n+    #                 \"recommendation\": \"Replace when possible.\",\n+    # ...\n+    with urlopen(url) as response:\n+        entries = json5.loads(response.read())['data']\n+\n+    wordlist = []\n+    for item in entries:\n+        tier = int(item['tier'])\n+        if tiers.count(tier) > 0:\n+            # convert minus sign to minus or space regex\n+            pattern = item['term'].replace('-', '[- ]')\n+            wordlist.append(pattern.lower())\n+    return wordlist\n+\n+\n+def process(args):\n+    \"Find matching words\"\n+\n+    # Default to Tier 1, 2 and 3.\n+    if args.tier:\n+        tiers = args.tier\n+    else:\n+        tiers = list(range(1, 4))\n+\n+    wordlist = fetch_wordlist(args.url, tiers)\n+    if args.debug:\n+        print(f'Matching on {len(wordlist)} words')\n+\n+    cmd = ['git', 'grep', '-i']\n+    if args.files_with_matches:\n+        cmd.append('-l')\n+    if args.count:\n+        cmd.append('-c')\n+    for word in wordlist:\n+        cmd.append('-e')\n+        cmd.append(word)\n+    cmd.append('--')\n+    # convert the exception_list to regexp\n+    for path in exception_list:\n+        cmd.append(f':^{path}')\n+    cmd += args.paths\n+    if args.debug:\n+        print(cmd)\n+    subprocess.run(cmd)\n+\n+\n+def main():\n+    process(args_parse())\n+\n+\n+if __name__ == \"__main__\":\n+    main()\n",
    "prefixes": [
        "v7"
    ]
}