-
Notifications
You must be signed in to change notification settings - Fork 498
[CI] Add uncrustify script and action #1532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jgromes
wants to merge
37
commits into
master
Choose a base branch
from
uncrustify
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
21e4116
[CI] Add uncrustify script and action
4f22265
[CI] Fix uncrustify install
e975b2a
[LR11x0] Chore: fixup firmware images
jgromes d2c876a
[CI] Force uncrustify 0.78.1
jgromes c14ef00
[HAL] Chore: uncrustify formatting
jgromes 203ff5f
[MOD] Chore: uncrustify formatting
jgromes 09792bf
[CC1101] Chore: uncrustify formatting
jgromes 393fd8b
[LLCC68] Chore: uncrustify formatting
jgromes e1c7f51
[LR11x0] Chore: uncrustify formatting
jgromes 40e4de8
[nRF24] Chore: uncrustify formatting
jgromes 70137f8
[RF69] Chore: uncrustify formatting
jgromes 3f3f794
[Si443x] Chore: uncrustify formatting
jgromes dbe87cc
[SX123x] Chore: uncrustify formatting
jgromes 5cad16a
[SX126x] Chore: uncrustify formatting
jgromes f96e6b3
[SX127x] Chore: uncrustify formatting
jgromes fa57770
[SX128x] Chore: uncrustify formatting
jgromes c4babb6
[AFSK] Chore: uncrustify formatting
jgromes d471f76
[APRS] Chore: uncrustify formatting
jgromes c927127
[AX25] Chore: uncrustify formatting
jgromes e42cb80
[Bell] Chore: uncrustify formatting
jgromes 2dddf71
[EXT] Chore: uncrustify formatting
jgromes 2765e1f
[FSK4] Chore: uncrustify formatting
jgromes 53f438b
[Hell] Chore: uncrustify formatting
jgromes e0c10a4
[LoRaWAN] Chore: uncrustify formatting
jgromes 08f2807
[Morse] Chore: uncrustify formatting
jgromes 9d51410
[Pager] Chore: uncrustify formatting
jgromes b2963ef
[PHY] Chore: uncrustify formatting
jgromes 45cc32b
[Print] Chore: uncrustify formatting
jgromes f1db249
[RTTY] Chore: uncrustify formatting
jgromes 496815e
[SSTV] Chore: uncrustify formatting
jgromes bb6b89d
[Utils] Chore: uncrustify formatting
jgromes 6fbe3d7
[CI] Update uncrustify config
jgromes f9f1a5d
[CI] Build uncrustify from source
jgromes 5374507
Merge branch 'master' into uncrustify
jgromes 9024ae1
Chore: apply formatting changes after merge
jgromes d176c6e
Merge branch 'master' into uncrustify
jgromes cda7d5d
[HAL] Apply changes after merge
jgromes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,33 @@ | ||
| name: "Uncrustify" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Run format check using uncrustify | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uncrustify | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y uncrustify | ||
|
|
||
| - name: Run uncrustify | ||
| run: ./extras/uncrustify/uncrustify.sh | ||
|
|
||
| - name: Upload patch file as artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: uncrustify.patch | ||
| path: extras/uncrustify/uncrustify.patch | ||
| if-no-files-found: ignore | ||
This file contains hidden or 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 @@ | ||
| uncrustify.patch |
This file contains hidden or 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 hidden or 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,24 @@ | ||
| #! /bin/bash | ||
|
|
||
| script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
| out_file=$script_dir/uncrustify.patch | ||
| rm $out_file | ||
|
|
||
| # for all soruce files, run uncrustify and save the output to a patch file | ||
| for file in $(find src/ -name '*.cpp' -or -name '*.h'); do | ||
| uncrustify -c $script_dir/uncrustify.cfg -f $file -o $file.uncrustify | ||
| diff -u $file $file.uncrustify >> $out_file | ||
| rm $file.uncrustify | ||
| done | ||
|
|
||
| cat $out_file | ||
|
|
||
| if [ -s $out_file ]; then | ||
| echo "Uncrustify finished and found some issues" | ||
| echo "Apply the patch file by: 'cd src && git apply $out_file'" | ||
| exit 1 | ||
| else | ||
| echo "Uncrustify finished - all OK!" | ||
| exit 0 | ||
| fi | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.