Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp349858pxj; Fri, 11 Jun 2021 00:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC4yls8ysxsBS/pGi90UkzeWZsDuyUTsd6OohqfsqnGnYGJYdwTe1xInP+CkNeWrGHXiSc X-Received: by 2002:a17:906:26ce:: with SMTP id u14mr2333212ejc.187.1623395996443; Fri, 11 Jun 2021 00:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623395996; cv=none; d=google.com; s=arc-20160816; b=jIivDpTsg/iF3Im88zlacpDHHS2XyI4VUxqAsWzXhNkV+9PG39MKoHv7l0g4d+f/Nd gXdaAJo3cwUiq9/Pu1242UpLJcuQdx4rADsVjtpxHzap4gmsjmR3++3O6BB3GQG5GnrT SscqSjr7baTs/gtEAcixeprxOByO/Czozw35XUoNcElmczv3xacSUfuDQwiRux4loSuJ nDb3flzNAJrcQtv9SdNZRTuW5VdxiyB4ClbdqK9ALzJ4zNXNxUvg7QZnN12nvi7cPaWW dHAUhxZQG8GyC5RPKLIssGvEexCbR7Y84Hf5p8YQxX4xTbLjd6dpFMqF6joVlzA8+mpp A2Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NuPpvXbFaULmA5tpZgNE7R2YR6o5OH6dz4jWxT8FUR4=; b=Oj8or8k1AeVrRKygATzFqWTKUDt9e8X2fMHVzM8feZui7lCGiJI469j8TDZG3Gl00D R+A3NAHYHC93Y2G5S2N2pepu/YzeMaE+x8NEpYhZ/dcd0X3V5DtzWSyQMvy3FSCjTce7 NlpZRYJO9xVBlp4DfPLwz5lXdByRy1pEF6h1P0k+R7j55wd3KAFnYMsXGFMIFw6Ehd1/ cEgQks1a3um4dnpXAXU1ImeUlr+rOu0a109Yq9R1CRCozP1s1FMYHdDcdOuxrfN7p7aG PmjaNcyfIqsKznghXlDToHia8jGSHvJL6ol7OSSBdSWKSzaRIrMHMDP2uyeO4+cPNwcu q59w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 27si4303533eja.1.2021.06.11.00.19.33; Fri, 11 Jun 2021 00:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231552AbhFKHTb (ORCPT + 99 others); Fri, 11 Jun 2021 03:19:31 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3959 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbhFKHT1 (ORCPT ); Fri, 11 Jun 2021 03:19:27 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G1XCM2ycGz6wDV; Fri, 11 Jun 2021 15:14:23 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 15:17:28 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 15:17:28 +0800 From: Zhen Lei To: Andrew Morton , Nicolas Dichtel , Joe Perches , Jason Baron , Stefani Seibold , Jacob Keller , Thomas Graf , Herbert Xu , Jens Axboe , Petr Mladek , Sergey Senozhatsky , "Andy Shevchenko" , Rasmus Villemoes , linux-kernel CC: Zhen Lei Subject: [PATCH 1/3] scripts: add spelling_sanitizer.sh script Date: Fri, 11 Jun 2021 15:12:39 +0800 Message-ID: <20210611071241.16728-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210611071241.16728-1-thunder.leizhen@huawei.com> References: <20210611071241.16728-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. So add this script. It removes the duplicates first, then sort by correctly spelled words. Sorting based on misspelled words is not chose because it is uncontrollable. Signed-off-by: Zhen Lei --- scripts/spelling_sanitizer.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/spelling_sanitizer.sh diff --git a/scripts/spelling_sanitizer.sh b/scripts/spelling_sanitizer.sh new file mode 100755 index 000000000000..4936c4191653 --- /dev/null +++ b/scripts/spelling_sanitizer.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +src=spelling.txt +tmp=spelling_mistake_correction_pairs.txt + +cd `dirname $0` + +# Convert the format of 'codespell' to the current +sed -r -i 's/ ==> /||/' $src + +# Move the spelling "mistake||correction" pairs into file $tmp +# There are currently 9 lines of comments in $src, so the text starts at line 10 +sed -n '10,$p' $src > $tmp +sed -i '10,$d' $src + +# Remove duplicates first, then sort by correctly spelled words +sort -u $tmp -o $tmp +sort -t '|' -k 3 $tmp -o $tmp + +# Append sorted results to comments +cat $tmp >> $src + +# Delete the temporary file +rm -f $tmp + +cd - > /dev/null -- 2.25.1