-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp32: docs: add coding style documentation
Document on how to use clangd as default formatter in vscode.
- Loading branch information
Showing
6 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: clang-format Check | ||
name: OGStarTracker CI | ||
on: [push, pull_request] | ||
jobs: | ||
formatting-check: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Coding style | ||
|
||
To keep the source code clean and tidy we use `clangd` in combination with the `.clang-format` configuration file. | ||
|
||
### Github Action Format Check | ||
|
||
Additionally every push and pull request will trigger a `Github Action` to check the formatting on all the source code. | ||
The output of the action should be `inspected` and the requested changes should be `applied` prior merging. | ||
|
||
### Using clangd locally | ||
|
||
1. To use `clangd` locally it is preferably installed via `Visual Studio Code Extensions`. | ||
2. Install the extension from the `Extension Marketplace`. | ||
|
||
![clangd Extension](img/vscode-clangd-extension.jpg) | ||
|
||
|
||
3. Configure your IDE to use the clangd formatter properly. | ||
![default formatter](img/vscode-default-formatter.jpg) | ||
![formatting settings](img/vscode-format-settings.jpg) | ||
|
||
4. Make your changes to the code and save the file to apply the formatting automatically. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.