Skip to content

Commit

Permalink
clang-format: disable column limit constraint
Browse files Browse the repository at this point in the history
The "ColumnLimit: 120" is not only allowing lines to be longer than 80
characters but it also forces line wrapping at 120 characters. If total
expression length is more than 120 characters, clang-format will try to
wrap it as close to 120 as it can, it would not even allow to wrap at 80
characters if we really want it. But as we all know 80 characters is
Linux kernel coding style default and as far as our coding style is
based on it it is really strange to prohibit wrapping lines at 80
characters...

Signed-off-by: Pavel Tikhomirov <[email protected]>
  • Loading branch information
Snorch authored and avagin committed Oct 6, 2023
1 parent c20fb83 commit 5bf7652
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 120
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false # Unknown to clang-format-4.0
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Expand Down
2 changes: 1 addition & 1 deletion scripts/fetch-clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/.c
curl -s "${URL}" | sed -e "
s,^\( *\)#\([A-Z]\),\1\2,g;
s,ControlStatements,ControlStatementsExceptForEachMacros,g;
s,ColumnLimit: 80,ColumnLimit: 120,g;
s,ColumnLimit: 80,ColumnLimit: 0,g;
s,Intended for clang-format >= 4,Intended for clang-format >= 11,g;
s,ForEachMacros:,ForEachMacros:\n - 'for_each_bit',g;
s,ForEachMacros:,ForEachMacros:\n - 'for_each_pstree_item',g;
Expand Down

0 comments on commit 5bf7652

Please sign in to comment.