From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Joe Perches <joe@perches.com>,
Andrew Morton <akpm@linux-foundation.org>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Jason Baron <jbaron@akamai.com>,
Stefani Seibold <stefani@seibold.net>,
Jacob Keller <jacob.e.keller@intel.com>,
Thomas Graf <tgraf@suug.ch>,
Herbert Xu <herbert@gondor.apana.org.au>,
Jens Axboe <axboe@kernel.dk>, Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
linux-kernel <linux-kernel@vger.kernel.org>,
Colin Ian King <colin.king@canonical.com>,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH 1/3] scripts: add spelling_sanitizer.sh script
Date: Tue, 22 Jun 2021 16:47:17 +0800 [thread overview]
Message-ID: <7431be94-ccda-70a9-429d-29c988433eb7@huawei.com> (raw)
In-Reply-To: <e2b35246-00fa-37a9-0c11-be178c974f65@huawei.com>
On 2021/6/16 19:58, Leizhen (ThunderTown) wrote:
>
>
> On 2021/6/15 15:01, Leizhen (ThunderTown) wrote:
>>
>>
>> On 2021/6/11 23:36, Joe Perches wrote:
>>> On Fri, 2021-06-11 at 15:12 +0800, Zhen Lei wrote:
>>>> The file scripts/spelling.txt recorded a large number of
>>>> "mistake||correction" pairs. These entries are currently maintained in
>>>> order, but the results are not strict. In addition, when someone wants to
>>>> add some new pairs, he either sort them manually or write a script, which
>>>> is clearly a waste of labor.
>>>
>>> Try using lintian's make sort
>>>
>>> https://salsa.debian.org/lintian/lintian
>
> I installed lintian and found no option to support sort. Can anyone give me more
> specific instructions on how to use it?
>
> Although I don't understand the perl language, after reading commit 66b47b4a9dad
> ("checkpatch: look for common misspellings"), it seems to match from top to bottom.
> So, as Andy Shevchenko says, they should be sorted by frequency of the word usage.
>
> I really don't know the details of the implementation of
> scripts/checkpatch.pl --types=typo_spelling. Are only misspelled words involved in
> spelling.txt matching? Otherwise, if correctly spelled words are also traversed,
> sorting by frequency makes no sense. Because the correct number of words is far more
> than the wrong number of words. If that's the case, then my modified script could
> come in handy.
>
> And if only misspelled words involved in spelling.txt matching, do we really need
> spelling.txt? Just output the misspelled words is enough. I don't think anyone needs
> to follow the tips to complete the fix.
Hi all:
I did a little test:
git rm -r drivers/usb --> then revert to generate patch 'usb, 553988 insertions(+)
git rm -r mm/ --> then revert to generate patch 'mm', 157606 insertions(+)
Two Stages(Test twice each, unit: seconds):
Before sorted by this patch:
mm 264 264
usb 1049 1047
After sorted by this patch:
mm 264 265
usb 1047 1045
According to the test results, the performance before and after sorting is basically the same.
The test method is as follows:
start=$(date +%s)
scripts/checkpatch.pl --types=TYPO_SPELLING 0001-Revert-usb-remove.patch > /dev/null
end=$(date +%s)
seconds=$((end - start))
echo $seconds
>
>>>
>>>
>>
>> Okay, I'll try it
>>
>>>
>>> .
>>>
next prev parent reply other threads:[~2021-06-22 8:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 7:12 [PATCH 0/3] scripts/spelling.txt: add some spelling pairs and reorder Zhen Lei
2021-06-11 7:12 ` [PATCH 1/3] scripts: add spelling_sanitizer.sh script Zhen Lei
2021-06-11 7:58 ` Andy Shevchenko
2021-06-11 9:30 ` Leizhen (ThunderTown)
2021-06-11 9:41 ` Andy Shevchenko
2021-06-11 9:58 ` Leizhen (ThunderTown)
2021-06-11 15:36 ` Joe Perches
2021-06-15 7:01 ` Leizhen (ThunderTown)
2021-06-16 11:58 ` Leizhen (ThunderTown)
2021-06-22 8:47 ` Leizhen (ThunderTown) [this message]
2021-06-11 7:12 ` [PATCH 2/3] scripts/spelling.txt: sort and remove duplicates Zhen Lei
2021-06-11 7:12 ` [PATCH 3/3] scripts/spelling.txt: add some spelling "mistake||correction" pairs Zhen Lei
2021-06-11 8:02 ` [PATCH 0/3] scripts/spelling.txt: add some spelling pairs and reorder Andy Shevchenko
2021-06-11 8:10 ` Andy Shevchenko
2021-06-11 9:48 ` Leizhen (ThunderTown)
2021-06-11 10:08 ` Andy Shevchenko
2021-06-11 8:12 ` Leizhen (ThunderTown)
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=7431be94-ccda-70a9-429d-29c988433eb7@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=axboe@kernel.dk \
--cc=colin.king@canonical.com \
--cc=herbert@gondor.apana.org.au \
--cc=jacob.e.keller@intel.com \
--cc=jbaron@akamai.com \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=nicolas.dichtel@6wind.com \
--cc=pmladek@suse.com \
--cc=senozhatsky@chromium.org \
--cc=stefani@seibold.net \
--cc=tgraf@suug.ch \
/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).