File: format-diff.ps1

package info (click to toggle)
pocl 7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 29,768 kB
  • sloc: lisp: 151,669; ansic: 135,425; cpp: 65,801; python: 1,846; sh: 1,084; ruby: 255; pascal: 231; tcl: 180; makefile: 174; asm: 81; java: 72; xml: 49
file content (20 lines) | stat: -rw-r--r-- 676 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# USAGE:
#
# 1) format-diff.ps1
# 2) format-diff.ps1 <commit>
#
# 1) formats current unstaged changes and 2) formats changes since the
# commit or changes between commit range (XREF..YREF).

# Set CWD to PoCL's repository root directory.
Push-Location "$PSScriptRoot\..\.."

git diff $args -U0 --no-color | py $PSScriptRoot\clang-format-diff.py `
  -v -regex '.*(\.h$|\.c$|\.cl$)' -i -p1 `
  -style=file:"$PSScriptRoot\style.GNU"

git diff $args -U0 --no-color | py $PSScriptRoot\clang-format-diff.py `
  -v -regex '(.*(\.hpp$|\.hh$|\.cc$|\.cpp$|lib\\llvmopencl\\(?!CMakeLists).*$|\\lib\\CL\\devices\\tce\\.*$))' `
  -i -p1 -style=file:"$PSScriptRoot\style.CPP"

Pop-Location