Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Developer Workflow

Zach Toogood edited this page Sep 6, 2020 · 1 revision

Setting up clang-format (Windows)

  • Load cmd as Administrator.
  • Install choco package manager with script below:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  • Install LLVM
choco install llvm -y
curl.exe --output C:\Program Files\LLVM\bin\clang-format-diff.py --url https://raw.githubusercontent.com/llvm-mirror/clang/master/tools/clang-format/clang-format-diff.py
refreshenv

Setting up clang-format (Linux)

sudo apt install clang-format

Using clang-format

  • To get a report of what (in your current changes) needs formatting:
git diff -U0 --no-color release...HEAD -- '*.cpp' '*.h' | clang-format-diff -p1
Clone this wiki locally