xref: /dpdk/devtools/build-dict.sh (revision b5458e2cc48349b314c7354e4ddfd2100bd55c29)
17dba4148SThomas Monjalon#! /bin/sh -e
27dba4148SThomas Monjalon# SPDX-License-Identifier: BSD-3-Clause
37dba4148SThomas Monjalon# Copyright 2020 Mellanox Technologies, Ltd
47dba4148SThomas Monjalon
57dba4148SThomas Monjalon# Build a spelling dictionary suitable for DPDK_CHECKPATCH_CODESPELL
67dba4148SThomas Monjalon
77dba4148SThomas Monjalon# path to local clone of https://github.com/codespell-project/codespell.git
87dba4148SThomas Monjaloncodespell_path=$1
95f33036cSStephen Hemmingerdic_path=$codespell_path/codespell_lib/data
105f33036cSStephen Hemmingerif [ ! -d "$dic_path" ]; then
115f33036cSStephen Hemminger	echo "Usage: $0 <path_to_codespell_project>" >&2
125f33036cSStephen Hemminger	exit 1
135f33036cSStephen Hemmingerfi
147dba4148SThomas Monjalon
157dba4148SThomas Monjalon# concatenate codespell dictionaries, except GB/US one
167dba4148SThomas Monjalonfor suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
175f33036cSStephen Hemminger	cat $dic_path/dictionary$suffix
187dba4148SThomas Monjalondone |
197dba4148SThomas Monjalon
207dba4148SThomas Monjalon# remove too short or wrong checks
217dba4148SThomas Monjalonsed '/^..->/d' |
227dba4148SThomas Monjalonsed '/^uint->/d' |
237dba4148SThomas Monjalonsed "/^doesn'->/d" |
247dba4148SThomas Monjalonsed '/^wasn->/d' |
255f33036cSStephen Hemmingersed '/^stdio->/d' |
26*b5458e2cSKonstantin Ananyevsed '/^soring->/d' |
277dba4148SThomas Monjalon
287dba4148SThomas Monjalon# print to stdout
297dba4148SThomas Monjaloncat
30