Skip to content

Commit 8aaf7a9

Browse files
committed
ci(astyle): use astyle-check instead of system one
Since Ubuntu 24.4, astyle package does not accept the same options. Signed-off-by: Frederic Pillon <[email protected]>
1 parent b296d8d commit 8aaf7a9

File tree

5 files changed

+404
-251
lines changed

5 files changed

+404
-251
lines changed

.astyleignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
docs
3+
api-docs
4+
system
5+
src/STM32CubeWL
6+
src/BSP/timer_if.c
7+
src/BSP/timer_if.h
8+
src/BSP/rtc.c
9+
src/BSP/rtc.h

.github/workflows/check-astyle.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
name: Check code formatting with astyle
2-
32
on:
43
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '*'
8+
- '**.md'
9+
- '**.txt'
510
pull_request:
11+
paths-ignore:
12+
- '*'
13+
- '**.md'
14+
- '**.txt'
615
# Allows you to run this workflow manually from the Actions tab
716
workflow_dispatch:
817
jobs:
9-
check:
10-
name: Check for astyle errors
18+
astyle_check:
1119
runs-on: ubuntu-latest
12-
20+
name: Check for astyle errors
1321
steps:
14-
- run: sudo apt install astyle
15-
- uses: actions/checkout@v3
16-
- run: astyle --project=.astylerc --recursive '*.c' '*.h'
17-
# If anything changed, this will fail and show the needed changes
18-
- run: git diff --exit-code
22+
# First of all, clone the repo using the checkout action.
23+
- name: Checkout
24+
uses: actions/checkout@main
25+
26+
- name: Astyle check
27+
id: Astyle
28+
uses: stm32duino/actions/astyle-check@main
29+
with:
30+
astyle-definition: '.astylerc'
31+
ignore-path-list: '.astyleignore'
32+
33+
# Use the output from the `Astyle` step
34+
- name: Astyle Errors
35+
if: failure()
36+
run: |
37+
cat ${{ steps.Astyle.outputs.astyle-result }}
38+
exit 1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.clangd
2+
.development
23
.gdb_history
34
build
45
sketch.json
56
api-docs
7+
astyle.out

src/BSP/mw_log.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
#include <stdarg.h>
3939
#include <core_debug.h>
4040

41-
void MW_LOG([[gnu::unused]] MwLogTimestamp_t ts, [[gnu::unused]] MwLogLevel_t level, const char* fmt, ...)
41+
void MW_LOG([[gnu::unused]] MwLogTimestamp_t ts, [[gnu::unused]] MwLogLevel_t level, const char *fmt, ...)
4242
{
43-
va_list ap;
44-
va_start(ap, fmt);
45-
vcore_debug(fmt, ap);
46-
va_end(ap);
43+
va_list ap;
44+
va_start(ap, fmt);
45+
vcore_debug(fmt, ap);
46+
va_end(ap);
4747
}

0 commit comments

Comments
 (0)