All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Joe Perches <joe@perches.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>
Subject: Re: [PATCH 1/3] scripts: add spelling_sanitizer.sh script
Date: Fri, 11 Jun 2021 12:41:55 +0300	[thread overview]
Message-ID: <CAHp75VeybOch9xUwy5vtufenBA2unb61sGAVoCdTpy2tRcCxLg@mail.gmail.com> (raw)
In-Reply-To: <81415ec7-078c-fb3f-2373-3f46608fe39e@huawei.com>

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.


-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-06-11  9:43 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 [this message]
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)
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=CAHp75VeybOch9xUwy5vtufenBA2unb61sGAVoCdTpy2tRcCxLg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=herbert@gondor.apana.org.au \
    --cc=jacob.e.keller@intel.com \
    --cc=jbaron@akamai.com \
    --cc=joe@perches.com \
    --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 \
    --cc=thunder.leizhen@huawei.com \
    --subject='Re: [PATCH 1/3] scripts: add spelling_sanitizer.sh script' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.