From 908901ab1809fae693b6bb8090e0fc687d883fbb Mon Sep 17 00:00:00 2001 From: Kenix3 Date: Fri, 11 Oct 2024 20:47:24 -0400 Subject: [PATCH] Adds Powershell one-liner to run clang-format (#684) --- CONTRIBUTING.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f9c357..706a797 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,15 @@ Our CI system will automatically check your PR to ensure that it fits [formattin #### tidy-format-validation If the tidy-format-validation check fails, then you need to run clang-format. Below is a command that can be used on Linux. Most modern IDEs have a clang-format plugin that can be used. The [.clang-format file can be found here](https://github.com/Kenix3/libultraship/blob/main/.clang-format) ##### Running clang-format +###### From within the LUS directory. +Ensure clang-format-12 is installed and available through your system path. + +Bash: ``` find src include -name "*.cpp" -o -name "*.h" | sed 's| |\\ |g' | xargs clang-format-12 -i ``` + +Powershell: +``` +Get-ChildItem -Recurse -Path .\src -Include *.cpp, *.h -File | ForEach-Object { clang-format-12.exe -i $_.FullName } +``` \ No newline at end of file