Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp438031pxj; Fri, 11 Jun 2021 03:01:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWNDyMctvBlUC5wsLuC1+8zQT1DGUGCEsFW7aDKiJ4z+QJ3jHcIxImJTbC6Ox0M7dg4r8/ X-Received: by 2002:a17:906:8319:: with SMTP id j25mr2853392ejx.479.1623405663101; Fri, 11 Jun 2021 03:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623405663; cv=none; d=google.com; s=arc-20160816; b=VHNm2VYdmct0rIaBcpof2mHRgXI9mGpalOtHihmVC6CuzHneHzrMl5wvAH8jj6p+fE TXuGkfYBRCiYB8TAB6BaK9VHJ1ZT4fqD1dEN032pVaNSPB5dMu//0JOLNyuFacFydZ2l s18L4fpa4oyBJXfEHfX3V9DwhCYCCKsGxBMtgwIMIVA6sG0vxG9HIt/iYw5H0NIN2mjz yHE5WvxegACQK4jt9HeOAo2jYiRgF7aCevCSnMsvOi7ew+qErptxBHBnNp2N4MrHQGI0 qbpO3g1SutJfs1iTuJrbbWMzr41XVERHWx0RHFtO73TxElvARd0iUqjj2YhBP6VlHt40 nn/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=LGU24x39NqypqgHmSpxgWWaEiuBEKhEO2dYz9QEsbj4=; b=VmtNTgvRijp46hK7DSYuqVpMDGbfocvAytF/KEjw94JNrbHkzaW8MYukma0q9fx8TR AkzuFStMlf9ULZeDMFsGQC79ydoCavz67nO6mtwr2KB7aUePuU8IjwGtlCFkxyubWefA n4lZwFs0wp3HKED51pDcbzVRrlxxsITok/8Bd2Vl96ab7EW4J2Q8TjssSg8QX54yvjFV ncKsSUZA7Pd9qb8XoN+4PqvppVVN1GXPsOmgTQLd8UXukxJS7WjjoI1rZDvN/yv2Oz0t UNsz3bmEto3PGNnaO6s7i8lJX2paPWOWIx0A56JDsHuDEh8An5Z+9l/h6sszHbJnSvok 5Fjw== 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 he38si4694703ejc.308.2021.06.11.03.00.38; Fri, 11 Jun 2021 03:01:03 -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 S231391AbhFKKAz (ORCPT + 99 others); Fri, 11 Jun 2021 06:00:55 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:6269 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbhFKKAv (ORCPT ); Fri, 11 Jun 2021 06:00:51 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G1blP0dCwz1BLPK; Fri, 11 Jun 2021 17:53:53 +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 17:58:47 +0800 Received: from [127.0.0.1] (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 17:58:46 +0800 Subject: Re: [PATCH 1/3] scripts: add spelling_sanitizer.sh script To: Andy Shevchenko CC: 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 References: <20210611071241.16728-1-thunder.leizhen@huawei.com> <20210611071241.16728-2-thunder.leizhen@huawei.com> <81415ec7-078c-fb3f-2373-3f46608fe39e@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: <095186fe-b4a5-12dc-15f8-d9337187ffdb@huawei.com> Date: Fri, 11 Jun 2021 17:58:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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 On 2021/6/11 17:41, Andy Shevchenko wrote: > On Fri, Jun 11, 2021 at 12:30 PM Leizhen (ThunderTown) > wrote: >> On 2021/6/11 15:58, Andy Shevchenko wrote: >>> On Fri, Jun 11, 2021 at 10:19 AM Zhen Lei wrote: > > ... > >>>> +# 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 >>> >>> This is fragile, use proper comment line detection. >> >> I've thought about that too. But I'm wondering if it needs to be that >> complicated. >> >> Think about it. It's not something for personal temporary use, so it >> should be perfect. I'll change to dynamic computing. > > sed has a possibility to choose between two anchors. > > Google for `sed -e '/anchor 1/,/anchor 2/'` expressions. So, it will > be less complicated than current code. OK, thanks. I'm off work. I'll post the v2 next week. > >