clang-format: Update ColumnLimit
PATCH 1/1 clang-format: Update ColumnLimit
Update ColumnLimit value, changed from 80 to 100.
--- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
.clang-format +1 -1
@@ -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
Signature · 1 line
2.30.2
Quoted 23 lines · Ansuel Smith
Update ColumnLimit value, changed from 80 to 100.
Signed-off-by Ansuel Smith <[email protected]>--- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-).clang-format +1
-1@@ -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: falseSignature · 1 line
2.30.2
Not sure how opinions have changed since but this has come up before:
https://lore.kernel.org/r/[email protected]/
Cheers,
Nathan
Quoted 27 lines · Nathan Chancellor
Quoted 23 lines · Ansuel Smith
Update ColumnLimit value, changed from 80 to 100.
Signed-off-by Ansuel Smith <[email protected]>--- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-).clang-format +1
-1@@ -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: falseSignature · 1 line
2.30.2Not sure how opinions have changed since but this has come up before:
Quoted 2 lines
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.
Quoted 2 lines
Cheers,
Nathan
Quoted 4 lines · Ansuel Smith
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
Quoted 7 lines · Miguel Ojeda
Quoted 4 lines · Ansuel Smith
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.