-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Sylensky/feature/clang-formatting
Feature/clang formatting
- Loading branch information
Showing
23 changed files
with
1,222 additions
and
1,093 deletions.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: OGStarTracker CI | ||
on: [push] | ||
jobs: | ||
formatting-check: | ||
name: Formatting Check | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
path: | ||
- check: 'esp32_wireless_control/firmware' | ||
exclude: '(shared)' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run clang-format style check for C/C++ programs. | ||
uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: '13' | ||
check-path: ${{ matrix.path['check'] }} | ||
exclude-regex: ${{ matrix.path['exclude'] }} |
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.
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,23 @@ | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
UseTab: Never | ||
BreakBeforeBraces: Allman | ||
AllowShortFunctionsOnASingleLine: None | ||
ColumnLimit: 100 | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
IndentCaseLabels: true | ||
IndentWrappedFunctionNames: false | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
PointerAlignment: Left | ||
ReflowComments: true | ||
SortIncludes: true | ||
SpaceAfterCStyleCast: true | ||
SpaceBeforeParens: ControlStatements | ||
SpacesInAngles: false | ||
SpacesInContainerLiterals: true | ||
SpacesInParentheses: false | ||
Standard: Cpp11 |
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
Oops, something went wrong.