diff options
| author | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
| commit | ca32c59a58d37c1822e185a2d5f3d0d3e8943593 (patch) | |
| tree | b06b9eec03f34344ef8fc31aa147b2714d3962ee /PxShared/buildtools/clang-format | |
| parent | Forced rename of platform folders in cmake dir. Git didn't pick this up before. (diff) | |
| download | nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip | |
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'PxShared/buildtools/clang-format')
| -rw-r--r-- | PxShared/buildtools/clang-format/clang-format-all.bat | 24 | ||||
| -rw-r--r-- | PxShared/buildtools/clang-format/clang-format-p4.bat | 24 | ||||
| -rw-r--r-- | PxShared/buildtools/clang-format/clang-format.exe | bin | 0 -> 2377728 bytes | |||
| -rw-r--r-- | PxShared/buildtools/clang-format/directories.txt | 4 |
4 files changed, 52 insertions, 0 deletions
diff --git a/PxShared/buildtools/clang-format/clang-format-all.bat b/PxShared/buildtools/clang-format/clang-format-all.bat new file mode 100644 index 0000000..1006b00 --- /dev/null +++ b/PxShared/buildtools/clang-format/clang-format-all.bat @@ -0,0 +1,24 @@ +@echo off +setlocal enabledelayedexpansion + +set BLAST_PATH=..\.. + +set /a count=0 +set /a fail=0 +for /F %%d IN (directories.txt) do ( + call :check %BLAST_PATH%\%%d +) + +echo %fail% of %count% files reformatted. +exit /b %fail% + +:check +for /R "%1" %%f in (*.h, *.cpp, *.cu, *.hlsl) do ( + p4 edit %%f + clang-format.exe -i %%f + if errorlevel 1 ( + echo %%f + set /a fail += 1 + ) + set /a count += 1 +) diff --git a/PxShared/buildtools/clang-format/clang-format-p4.bat b/PxShared/buildtools/clang-format/clang-format-p4.bat new file mode 100644 index 0000000..0b246e3 --- /dev/null +++ b/PxShared/buildtools/clang-format/clang-format-p4.bat @@ -0,0 +1,24 @@ +@echo off +setlocal + +set BLAST_PATH=..\.. + +if "%*"=="" ( + echo Usage: format-change.bat ^<p4 changelist #^> + exit /b +) + +set change=%~1 +for /F %%d IN (directories.txt) do ( + call :format %BLAST_PATH%\%%d +) + +exit /b + +:format +for /F "delims=#" %%a in ('p4 opened -c %change% %~f1\....h, %~f1\....cpp, %~f1\....cu, %~f1\....hlsl 2^> NUL') do ( + for /F "tokens=3" %%f IN ('p4 where %%a') do ( + echo %%f + clang-format.exe -i %%f + ) +) diff --git a/PxShared/buildtools/clang-format/clang-format.exe b/PxShared/buildtools/clang-format/clang-format.exe Binary files differnew file mode 100644 index 0000000..9c91ddf --- /dev/null +++ b/PxShared/buildtools/clang-format/clang-format.exe diff --git a/PxShared/buildtools/clang-format/directories.txt b/PxShared/buildtools/clang-format/directories.txt new file mode 100644 index 0000000..1dc947f --- /dev/null +++ b/PxShared/buildtools/clang-format/directories.txt @@ -0,0 +1,4 @@ +source\common +source\extensions +source\solver +shared\utils |