From fac7086cb02d7b805a1cadfa6b2a05db313f9ccc Mon Sep 17 00:00:00 2001 From: jLynx Date: Fri, 19 May 2023 07:52:09 +1200 Subject: [PATCH] Updated Code formatting (markdown) --- Code-formatting.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Code-formatting.md b/Code-formatting.md index 741d021..8be1fe1 100644 --- a/Code-formatting.md +++ b/Code-formatting.md @@ -1,4 +1,21 @@ For this we are using clang format version 13. All the config for this is in the .clang-format file. Your IDE should automatically pick up on this when you format your code. -**VS Code** -Make sure you have C/C++ extension by Microsoft installed and it should automatically pick up your .clang-format file. If not, you can go to the extension settings and specify the location under the `Clang_format_style` setting \ No newline at end of file +## VS Code +Make sure you have C/C++ extension by Microsoft installed and it should automatically pick up your .clang-format file. If not, you can go to the extension settings and specify the location under the `Clang_format_style` setting + +## CLI +To format using CLI, make sure you have clang-format-13 installed + +``` +wget https://apt.llvm.org/llvm.sh +chmod +x llvm.sh +sudo ./llvm.sh 13 +sudo apt install clang-format-13 +``` + +Then you can run +``` +find firmware/common -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' -o -iname '*.c' | xargs clang-format-13 -style=file -i +find firmware/baseband -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' -o -iname '*.c' | xargs clang-format-13 -style=file -i +find firmware/application -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' -o -iname '*.c' | xargs clang-format-13 -style=file -i +``` \ No newline at end of file