Skip to content

Commit

Permalink
esp32: docs: add coding style documentation
Browse files Browse the repository at this point in the history
Document on how to use clangd as default formatter in vscode.
  • Loading branch information
Sylensky committed Dec 15, 2024
1 parent db39777 commit 4084a70
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
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:
Expand Down
6 changes: 6 additions & 0 deletions esp32_wireless_control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ If you like this work, feel free to connect with me on [Github](https://github.c
## Table of Contents
- [PCB](pcb/README.md)
- [Compiling](docs/compiling.md)
- [Coding Style](docs/coding-style.md)


## Building guide
Expand All @@ -44,3 +45,8 @@ After connection was successful the tracker to actually control it access the **

If the webserver is not enough there is a app available to improve the accessibility even further.
Check out https://github.com/OndraGejdos/OG-star-tracker-App for more details.

## Contributing

When contributing to the project please make sure to follow the [coding style](docs/coding-style.md) prior creating a pull request.
With this we can make sure to keep a clean and tidy codespace.
22 changes: 22 additions & 0 deletions esp32_wireless_control/docs/coding-style.md
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.

0 comments on commit 4084a70

Please sign in to comment.