...
Note |
---|
This purposely will ignore and not format auto generated files like main.c and all HAL files. This is okay and intentional. Dont manually format them. |
To setup and run the clang format:
...
Open VScode from any NER C project. You must do this once for every project!
Open file-->preferences-->settings
Make sure you are on “workspace” settings and not “user” settings
Type clang in the settings search bar
Change
C_Cpp: Clang_format_fallback Style
tonone
IF in Cerb, Shep, etc. Change
C_Cpp: Clang_format_style
tofile:${workspaceRoot}/Drivers/Embedded-Base/clang-format
IF in Embedded-Base: Change
C_Cpp: Clang_format_style
tofile:${workspaceRoot}/clang-format
Change
editor.formatOnSave
tofalse
Note that with these settings, the linter will run automatically every time you save a file in VScode. If you prefer this not to happen, you can opt out of this by ignoring step 6 above. In doing so, the linter will not The linter will not run on save, and will have to be done with Ctr + Shft + i.
In CLI:
Debian based Linux/WSL:
...