2020-07-03 08:12:02

by Zong Li

[permalink] [raw]
Subject: [PATCH] scripts/Lindent: increase the maximum line length to 100

As the patch 'bdc48fa11e46 ("checkpatch/coding-style: deprecate
80-column warning")', increase the default limit to 100 characters,
we also increase the maximum line length to 100 for indent script.

Signed-off-by: Zong Li <[email protected]>
---
scripts/Lindent | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Lindent b/scripts/Lindent
index 1688c44c2df6..11f14a4f2048 100755
--- a/scripts/Lindent
+++ b/scripts/Lindent
@@ -1,7 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

-PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
+PARAM="-npro -kr -i8 -ts8 -sob -l100 -ss -ncs -cp1"

RES=`indent --version | cut -d' ' -f3`
if [ "$RES" = "" ]; then
--
2.27.0


2020-07-03 08:54:56

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, 2020-07-03 at 16:08 +0800, Zong Li wrote:
> As the patch 'bdc48fa11e46 ("checkpatch/coding-style: deprecate
> 80-column warning")', increase the default limit to 100 characters,
> we also increase the maximum line length to 100 for indent script.

I'd prefer to delete Lindent instead.

Also any reformatting tool like this will
_always_ use up to whatever the maximum
line length is rather than use a preferred
length of 80 and and only use the allowed
maximum length of 100 when necessary for
human readability.

> Signed-off-by: Zong Li <[email protected]>
> ---
> scripts/Lindent | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Lindent b/scripts/Lindent
> index 1688c44c2df6..11f14a4f2048 100755
> --- a/scripts/Lindent
> +++ b/scripts/Lindent
> @@ -1,7 +1,7 @@
> #!/bin/sh
> # SPDX-License-Identifier: GPL-2.0
>
> -PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
> +PARAM="-npro -kr -i8 -ts8 -sob -l100 -ss -ncs -cp1"
>
> RES=`indent --version | cut -d' ' -f3`
> if [ "$RES" = "" ]; then

2020-07-03 09:22:32

by Zong Li

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, Jul 3, 2020 at 4:51 PM Joe Perches <[email protected]> wrote:
>
> On Fri, 2020-07-03 at 16:08 +0800, Zong Li wrote:
> > As the patch 'bdc48fa11e46 ("checkpatch/coding-style: deprecate
> > 80-column warning")', increase the default limit to 100 characters,
> > we also increase the maximum line length to 100 for indent script.
>
> I'd prefer to delete Lindent instead.
>
> Also any reformatting tool like this will
> _always_ use up to whatever the maximum
> line length is rather than use a preferred
> length of 80 and and only use the allowed
> maximum length of 100 when necessary for
> human readability.
>

Yes, as you mentioned, the reformatting tool uses up to the maximum line length,
it seems to me that we don't go this patch if you plan to post the
patch to delete it,
otherwise, we could consider to change it to 100.

> > Signed-off-by: Zong Li <[email protected]>
> > ---
> > scripts/Lindent | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/Lindent b/scripts/Lindent
> > index 1688c44c2df6..11f14a4f2048 100755
> > --- a/scripts/Lindent
> > +++ b/scripts/Lindent
> > @@ -1,7 +1,7 @@
> > #!/bin/sh
> > # SPDX-License-Identifier: GPL-2.0
> >
> > -PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
> > +PARAM="-npro -kr -i8 -ts8 -sob -l100 -ss -ncs -cp1"
> >
> > RES=`indent --version | cut -d' ' -f3`
> > if [ "$RES" = "" ]; then
>

2020-07-03 09:41:27

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, Jul 3, 2020 at 11:19 AM Zong Li <[email protected]> wrote:
>
> Yes, as you mentioned, the reformatting tool uses up to the maximum line length,
> it seems to me that we don't go this patch if you plan to post the
> patch to delete it,
> otherwise, we could consider to change it to 100.

For reference, we discussed this for the limit in `.clang-format`, and
for the moment we will keep the limit at 80 there too.

See https://lore.kernel.org/lkml/[email protected]/

Cheers,
Miguel

2020-07-03 09:43:12

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, Jul 3, 2020 at 10:51 AM Joe Perches <[email protected]> wrote:
>
> I'd prefer to delete Lindent instead.

+1, especially since there is `clang-format` now.

Cheers,
Miguel

2020-07-03 09:52:18

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, 2020-07-03 at 11:41 +0200, Miguel Ojeda wrote:
> On Fri, Jul 3, 2020 at 10:51 AM Joe Perches <[email protected]> wrote:
> > I'd prefer to delete Lindent instead.
>
> +1, especially since there is `clang-format` now.

Awhile back I did send a patch:
https://lore.kernel.org/lkml/1360610974.28491.6.camel@joe-AO722/


2020-07-03 10:25:08

by Zong Li

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, Jul 3, 2020 at 5:51 PM Joe Perches <[email protected]> wrote:
>
> On Fri, 2020-07-03 at 11:41 +0200, Miguel Ojeda wrote:
> > On Fri, Jul 3, 2020 at 10:51 AM Joe Perches <[email protected]> wrote:
> > > I'd prefer to delete Lindent instead.
> >
> > +1, especially since there is `clang-format` now.

Agree, it is often used.

>
> Awhile back I did send a patch:
> https://lore.kernel.org/lkml/1360610974.28491.6.camel@joe-AO722/
>
>

Cool, let us go the patch above.

2020-07-03 10:35:36

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] scripts/Lindent: increase the maximum line length to 100

On Fri, 2020-07-03 at 18:22 +0800, Zong Li wrote:
> On Fri, Jul 3, 2020 at 5:51 PM Joe Perches <[email protected]> wrote:
> > On Fri, 2020-07-03 at 11:41 +0200, Miguel Ojeda wrote:
> > > On Fri, Jul 3, 2020 at 10:51 AM Joe Perches <[email protected]> wrote:
> > > > I'd prefer to delete Lindent instead.
> > >
> > > +1, especially since there is `clang-format` now.
>
> Agree, it is often used.
>
> > Awhile back I did send a patch:
> > https://lore.kernel.org/lkml/1360610974.28491.6.camel@joe-AO722/
> >
> Cool, let us go the patch above.

You are welcome to refresh it as a lot has
changed in the 7.5 years since then.