From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 5216E3421 for ; Thu, 28 Feb 2019 23:09:06 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D361300AC4; Thu, 28 Feb 2019 22:09:05 +0000 (UTC) Received: from localhost.localdomain (unknown [10.18.25.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id D59F01001DEE; Thu, 28 Feb 2019 22:09:04 +0000 (UTC) To: Thomas Monjalon Cc: dev@dpdk.org, Van Haaren Harry , ramirose@gmail.com, Bruce Richardson References: <20190213190813.12702-1-msantana@redhat.com> <20190214193547.30783-1-msantana@redhat.com> <20190214193547.30783-2-msantana@redhat.com> <4146661.2v2ioqZAr6@xps> From: Michael Santana Francisco Organization: Red Hat Message-ID: Date: Thu, 28 Feb 2019 17:09:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <4146661.2v2ioqZAr6@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 28 Feb 2019 22:09:05 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v2 1/2] Enable codespell by default. Can be disabled from config file. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: msantana@redhat.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 22:09:06 -0000 On 2/28/19 6:21 AM, Thomas Monjalon wrote: > 14/02/2019 20:35, Michael Santana: >> Enable codespell by default. >> codespell is a feature by checkpatch.pl that >> checks for common spelling mistakes in patches. > What is the difference between codespell and spelling.txt included > with checkpatch? > Is it just a different dictionary? codespell has a larger dictionary, about 15000 word fixes whereas spelling.txt has about 1000. That's really the only big difference > >> This feature is disabled by default. To enable it one must add >> the '--codespell' flag to the $options variable in >> checkpatches.sh. > We need also to specify the dictionary path if not in > /usr/share/codespell/dictionary.txt > In my case, it is in /usr/lib/python3.7/site-packages/codespell_lib/data/dictionary.txt > >> With this change codespell is enabled by default. > It seems it is not enabled by default, > because we need DPDK_CHECKPATCH_CODESPELL=enable V2 sets DPDK_CHECKPATCH_CODESPELL=enable at the beginning of checkpatches, right before reading in the config files. If DPDK_CHECKPATCH_CODESPELL is set in one of the config files it overwrites the enabled by default. This way a user can disable it via a config file > >> The user can decide to turn off codespell from a one of the config >> files read by checkpatches.sh. > [...] >> # override default Linux options >> options="--no-tree" >> +if [ "$DPDK_CHECKPATCH_CODESPELL" == "enable" ]; then > What about allowing either "enable" or a path? > If it is a path (have some slash), then we can add --codespellfile option. I like your thinking. We can use `if [ -f ]` to see if the path given is an existing file. so, if DPDK_CHECKPATCH_CODESPELL is set to enable, then enable it with default path (the way it is right now) if DPDK_CHECKPATCH_CODESPELL is set to a valid path to a file then enable codespell and set --codespellfile to said file otherwise if it's not set to enable or set to a valid path file, then assume it's disabled. Missed anything? > >> + options="$options --codespell" >> +fi >> options="$options --max-line-length=$length" >> options="$options --show-types" >> options="$options --ignore=LINUX_VERSION_CODE,\ >> > > > >