DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] devtools: add checkpatch spelling dictionary builder
@ 2020-07-07  8:54 Thomas Monjalon
  2020-07-30 21:49 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2020-07-07  8:54 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, ferruh.yigit

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] devtools: add checkpatch spelling dictionary builder
  2020-07-07  8:54 [dpdk-dev] [PATCH] devtools: add checkpatch spelling dictionary builder Thomas Monjalon
@ 2020-07-30 21:49 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2020-07-30 21:49 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, ferruh.yigit, Thomas Monjalon

07/07/2020 10:54, Thomas Monjalon:
> 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>

Applied




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07  8:54 [dpdk-dev] [PATCH] devtools: add checkpatch spelling dictionary builder Thomas Monjalon
2020-07-30 21:49 ` Thomas Monjalon

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox