mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
This is done to follow 'Linux kernel coding style', same change was
added to .clang-format in linux kernel source recently:
d7f6604341
We don't change it in current code base but let's follow it in all
future uses.
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
18 lines
768 B
Bash
Executable file
18 lines
768 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: 120,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
|