linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clang-format: Update ColumnLimit
@ 2021-03-19 18:37 Ansuel Smith
  2021-03-19 18:42 ` Nathan Chancellor
  0 siblings, 1 reply; 5+ messages in thread
From: Ansuel Smith @ 2021-03-19 18:37 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Ansuel Smith, Nathan Chancellor, Nick Desaulniers, linux-kernel,
	clang-built-linux

Update ColumnLimit value, changed from 80 to 100.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 .clang-format | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.clang-format b/.clang-format
index c24b147cac01..3212542df113 100644
--- a/.clang-format
+++ b/.clang-format
@@ -52,7 +52,7 @@ BreakConstructorInitializersBeforeComma: false
 #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
 BreakAfterJavaFieldAnnotations: false
 BreakStringLiterals: false
-ColumnLimit: 80
+ColumnLimit: 100
 CommentPragmas: '^ IWYU pragma:'
 #CompactNamespaces: false # Unknown to clang-format-4.0
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] clang-format: Update ColumnLimit
  2021-03-19 18:37 [PATCH] clang-format: Update ColumnLimit Ansuel Smith
@ 2021-03-19 18:42 ` Nathan Chancellor
  2021-03-19 18:45   ` Ansuel Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2021-03-19 18:42 UTC (permalink / raw)
  To: Ansuel Smith
  Cc: Miguel Ojeda, Nick Desaulniers, linux-kernel, clang-built-linux

On Fri, Mar 19, 2021 at 07:37:14PM +0100, Ansuel Smith wrote:
> Update ColumnLimit value, changed from 80 to 100.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> ---
>  .clang-format | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.clang-format b/.clang-format
> index c24b147cac01..3212542df113 100644
> --- a/.clang-format
> +++ b/.clang-format
> @@ -52,7 +52,7 @@ BreakConstructorInitializersBeforeComma: false
>  #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
>  BreakAfterJavaFieldAnnotations: false
>  BreakStringLiterals: false
> -ColumnLimit: 80
> +ColumnLimit: 100
>  CommentPragmas: '^ IWYU pragma:'
>  #CompactNamespaces: false # Unknown to clang-format-4.0
>  ConstructorInitializerAllOnOneLineOrOnePerLine: false
> -- 
> 2.30.2
> 

Not sure how opinions have changed since but this has come up before:

https://lore.kernel.org/r/20200610125147.2782142-1-christian.brauner@ubuntu.com/

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clang-format: Update ColumnLimit
  2021-03-19 18:42 ` Nathan Chancellor
@ 2021-03-19 18:45   ` Ansuel Smith
  2021-03-19 18:48     ` Miguel Ojeda
  0 siblings, 1 reply; 5+ messages in thread
From: Ansuel Smith @ 2021-03-19 18:45 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Miguel Ojeda, Nick Desaulniers, linux-kernel, clang-built-linux

On Fri, Mar 19, 2021 at 11:42:34AM -0700, Nathan Chancellor wrote:
> On Fri, Mar 19, 2021 at 07:37:14PM +0100, Ansuel Smith wrote:
> > Update ColumnLimit value, changed from 80 to 100.
> > 
> > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > ---
> >  .clang-format | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/.clang-format b/.clang-format
> > index c24b147cac01..3212542df113 100644
> > --- a/.clang-format
> > +++ b/.clang-format
> > @@ -52,7 +52,7 @@ BreakConstructorInitializersBeforeComma: false
> >  #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
> >  BreakAfterJavaFieldAnnotations: false
> >  BreakStringLiterals: false
> > -ColumnLimit: 80
> > +ColumnLimit: 100
> >  CommentPragmas: '^ IWYU pragma:'
> >  #CompactNamespaces: false # Unknown to clang-format-4.0
> >  ConstructorInitializerAllOnOneLineOrOnePerLine: false
> > -- 
> > 2.30.2
> > 
> 
> Not sure how opinions have changed since but this has come up before:
> 
> https://lore.kernel.org/r/20200610125147.2782142-1-christian.brauner@ubuntu.com/
> 

Sorry, didn't notice that. Considering that checkpatch complains and
some reviewers actually state that 100 is the new limit, I think it's
time to update the file.

> Cheers,
> Nathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clang-format: Update ColumnLimit
  2021-03-19 18:45   ` Ansuel Smith
@ 2021-03-19 18:48     ` Miguel Ojeda
  2021-03-20  4:56       ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Miguel Ojeda @ 2021-03-19 18:48 UTC (permalink / raw)
  To: Ansuel Smith
  Cc: Nathan Chancellor, Miguel Ojeda, Nick Desaulniers, linux-kernel,
	clang-built-linux, Joe Perches

On Fri, Mar 19, 2021 at 7:45 PM Ansuel Smith <ansuelsmth@gmail.com> wrote:
>
> Sorry, didn't notice that. Considering that checkpatch complains and
> some reviewers actually state that 100 is the new limit, I think it's
> time to update the file.

IIUC, 80 is still the soft limit, but 100 is now the hard limit.

Cc'ing Joe.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clang-format: Update ColumnLimit
  2021-03-19 18:48     ` Miguel Ojeda
@ 2021-03-20  4:56       ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2021-03-20  4:56 UTC (permalink / raw)
  To: Miguel Ojeda, Ansuel Smith
  Cc: Nathan Chancellor, Miguel Ojeda, Nick Desaulniers, linux-kernel,
	clang-built-linux

On Fri, 2021-03-19 at 19:48 +0100, Miguel Ojeda wrote:
> On Fri, Mar 19, 2021 at 7:45 PM Ansuel Smith <ansuelsmth@gmail.com> wrote:
> > 
> > Sorry, didn't notice that. Considering that checkpatch complains and
> > some reviewers actually state that 100 is the new limit, I think it's
> > time to update the file.
> 
> IIUC, 80 is still the soft limit, but 100 is now the hard limit.

80 columns is still the strongly preferred limit.

From coding-style.rst:
-------------------------------
The preferred limit on the length of a single line is 80 columns.

Statements longer than 80 columns should be broken into sensible chunks,
unless exceeding 80 columns significantly increases readability and does
not hide information.
-------------------------------

IMO: clang-format is mechanical and, like checkpatch, doesn't have much
'taste'.

Ideally, 100 columns would only be used when long length identifiers
exist with some mechanism that determines statement complexity.

Today it's fairly easy to go beyond 80 columns even if a statement
is similar to
	a = b + c;
when identifier lengths are relatively long.

There are many existing 25+ character length identifiers, so the trivial
statement above if used with all identifiers of 25 characters or more
exceeds 80 columns.

So for some things, clang-format (and checkpatch) should allow > 80 column
lines for trivial statements like the above.

It's not a trivial implementation problem though.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-20  5:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 18:37 [PATCH] clang-format: Update ColumnLimit Ansuel Smith
2021-03-19 18:42 ` Nathan Chancellor
2021-03-19 18:45   ` Ansuel Smith
2021-03-19 18:48     ` Miguel Ojeda
2021-03-20  4:56       ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).