File: fetch-clang-format.sh

package info (click to toggle)
criu 4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,584 kB
  • sloc: ansic: 139,280; python: 7,484; sh: 3,824; java: 2,799; makefile: 2,659; asm: 1,137; perl: 206; xml: 117; exp: 45
file content (18 lines) | stat: -rwxr-xr-x 766 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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