DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH] devtools: add checkpatch spelling dictionary builder
Date: Tue,  7 Jul 2020 10:54:23 +0200	[thread overview]
Message-ID: <20200707085424.2317373-1-thomas@monjalon.net> (raw)

The script checkpatch.pl (used in checkpatches.sh) can use a dictionary
from the codespell project to check spelling.
There are multiple dictionaries to be used.

The script build-dict.sh concatenate multiple dictionaries and remove
some annoying false positives.

The dictionary built by this script must be saved in a file which
is referenced with the environment variable DPDK_CHECKPATCH_CODESPELL.
The easiest is to export this variable in ~/.config/dpdk/devel.config.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/build-dict.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 devtools/build-dict.sh

diff --git a/devtools/build-dict.sh b/devtools/build-dict.sh
new file mode 100755
index 0000000000..a8cac49029
--- /dev/null
+++ b/devtools/build-dict.sh
@@ -0,0 +1,22 @@
+#! /bin/sh -e
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2020 Mellanox Technologies, Ltd
+
+# Build a spelling dictionary suitable for DPDK_CHECKPATCH_CODESPELL
+
+# path to local clone of https://github.com/codespell-project/codespell.git
+codespell_path=$1
+
+# concatenate codespell dictionaries, except GB/US one
+for suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
+	cat $codespell_path/codespell_lib/data/dictionary$suffix
+done |
+
+# remove too short or wrong checks
+sed '/^..->/d' |
+sed '/^uint->/d' |
+sed "/^doesn'->/d" |
+sed '/^wasn->/d' |
+
+# print to stdout
+cat
-- 
2.27.0


             reply	other threads:[~2020-07-07  8:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07  8:54 Thomas Monjalon [this message]
2020-07-30 21:49 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200707085424.2317373-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).