From patchwork Tue Jul 7 08:54:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 73377 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7540A00BE; Tue, 7 Jul 2020 10:54:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 09E881D97D; Tue, 7 Jul 2020 10:54:47 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id D49311D683 for ; Tue, 7 Jul 2020 10:54:45 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 36A035C00E7; Tue, 7 Jul 2020 04:54:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 07 Jul 2020 04:54:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=IO0Tz+O/IvWI5Ijb3qDNyeD2rz 6BDEuhqP3dp4n3fWM=; b=wTyDuKORnTl0Do2T+8u9ZMfXD8CUilqOh/k1z6vGZw N5aIf9v6Dldwn9EfGJjL+YLYZiR+hvacEd6BNHywYhqFHCzATHDa5IpVshXnY0EA uheFXZJ76M6Thj44BQsReh8pSE3RFQ4q3Wzzj4GNm6UPY1kQ2tX/fhxFtd2OalfH PeeMhkCelveSWYVZqXOu3MURyzLCMKxJ4eCYgpqiJH/tOUOQ3HWq0pxVWqP19NWL e11UxeZAlA1Tu9FdyKSaWeZqaeB58UtTxoGCOo6e00sATudUq74klFzPbqqoYO6F f2BRlOV9tVuzgSXoNbZRyxw1AO5XG2/oEaEBuXcLPz7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=IO0Tz+O/IvWI5Ijb3 qDNyeD2rz6BDEuhqP3dp4n3fWM=; b=jSxpnQTz8b9ikBHSG4GmWai8OUaO65Vcr LmHVnGaXU270/0QBOkglHqveSKHPhHp4YODCNBhaZqqBavSFoGHwLX1D5yncaVaw Cf/XwPdZNzRnNTHgq4qHngbhCg90bEHIXCPQIheubDrjUUaTqN6YfghofqRZrFGw rjKcfarAO0UMsjN/lamQ15q05pcmdjUmwSQgKMFLTl8E2QCnRXlE8GqsL6v0A4FF E5HXsVS/gjplDxdT0zC7XAaynk5Lh6NOGGBD9nBqRgNxl7KrUK+ip6D1vNYtjpbi WbceUjAmhkehzvdBgijW4/tsH/VnOKuGbVl4245zTdrznVV2c6tQQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhn jhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepgfeufeejtedugfevtedtkedvke etfeeiffeiveegheejvedtheeviefgffeuhfeinecuffhomhgrihhnpehgihhthhhusgdr tghomhenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdr nhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B2D9D328005D; Tue, 7 Jul 2020 04:54:42 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, ferruh.yigit@intel.com Date: Tue, 7 Jul 2020 10:54:23 +0200 Message-Id: <20200707085424.2317373-1-thomas@monjalon.net> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] devtools: add checkpatch spelling dictionary builder X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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