lkml.org 
[lkml]   [2021]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] scripts: add spelling_sanitizer.sh script
From
Date


On 2021/6/11 17:41, Andy Shevchenko wrote:
> On Fri, Jun 11, 2021 at 12:30 PM Leizhen (ThunderTown)
> <thunder.leizhen@huawei.com> wrote:
>> On 2021/6/11 15:58, Andy Shevchenko wrote:
>>> On Fri, Jun 11, 2021 at 10:19 AM Zhen Lei <thunder.leizhen@huawei.com> 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.

>
>

\
 
 \ /
  Last update: 2021-06-11 12:00    [W:0.058 / U:1.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site