mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 01:51:51 +00:00
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 <ptikhomirov@virtuozzo.com>
19 lines
766 B
Bash
Executable File
19 lines
766 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# This script fetches .clang-format from the Linux kernel
|
|
# and slightly adapts it for CRIU.
|
|
|
|
URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/.clang-format?h=v5.13"
|
|
|
|
curl -s "${URL}" | sed -e "
|
|
s,^\( *\)#\([A-Z]\),\1\2,g;
|
|
s,ControlStatements,ControlStatementsExceptForEachMacros,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;
|
|
s,\(AlignTrailingComments:.*\)$,\1\nAlignConsecutiveMacros: true,g;
|
|
s,AlignTrailingComments: false,AlignTrailingComments: true,g;
|
|
s,\(IndentCaseLabels: false\),\1\nIndentGotoLabels: false,g;
|
|
" > .clang-format
|