Skip to content

Commit f255a34

Browse files
committed
Add clang-format CI
1 parent c5976e4 commit f255a34

File tree

8 files changed

+324
-307
lines changed

8 files changed

+324
-307
lines changed

.github/workflows/clang-format.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: clang-format
2+
3+
on:
4+
push:
5+
branches: ["main", "dev", "feature-*"]
6+
pull_request:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout butano-ldtk
13+
uses: actions/checkout@v4
14+
with:
15+
path: butano-ldtk
16+
17+
- name: Check clang-format style
18+
uses: jidicula/clang-format-action@v4.15.0
19+
with:
20+
clang-format-version: '20'

examples/common/include/common_info.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#define COMMON_INFO_H
88

99
#include "bn_span.h"
10-
#include "bn_vector.h"
1110
#include "bn_sprite_ptr.h"
1211
#include "bn_string_view.h"
12+
#include "bn_vector.h"
1313

1414
namespace bn
1515
{
16-
class sprite_text_generator;
16+
class sprite_text_generator;
1717
}
1818

1919
namespace common
@@ -48,6 +48,6 @@ class info
4848
void _update_sprites();
4949
};
5050

51-
}
51+
} // namespace common
5252

5353
#endif

examples/common/include/common_stats.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
#ifndef COMMON_STATS_H
77
#define COMMON_STATS_H
88

9-
#include "bn_vector.h"
109
#include "bn_sprite_ptr.h"
10+
#include "bn_vector.h"
1111

1212
namespace bn
1313
{
14-
class sprite_text_generator;
14+
class sprite_text_generator;
1515
}
1616

1717
namespace common
@@ -49,6 +49,6 @@ class stats
4949
int _counter = 0;
5050
};
5151

52-
}
52+
} // namespace common
5353

5454
#endif

examples/common/include/common_variable_8x16_sprite_font.h

Lines changed: 120 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -7,140 +7,139 @@
77
#define COMMON_VARIABLE_8x16_SPRITE_FONT_H
88

99
#include "bn_sprite_font.h"
10-
#include "bn_utf8_characters_map.h"
1110
#include "bn_sprite_items_common_variable_8x16_font.h"
11+
#include "bn_utf8_characters_map.h"
1212

1313
namespace common
1414
{
1515

16-
constexpr bn::utf8_character variable_8x16_sprite_font_utf8_characters[] = {
17-
"Á", "É", "Í", "Ó", "Ú", "Ü", "Ñ", "á", "é", "í", "ó", "ú", "ü", "ñ", "¡", "¿"
18-
};
16+
constexpr bn::utf8_character variable_8x16_sprite_font_utf8_characters[] = {"Á", "É", "Í", "Ó", "Ú", "Ü", "Ñ", "á",
17+
"é", "í", "ó", "ú", "ü", "ñ", "¡", "¿"};
1918

2019
constexpr int8_t variable_8x16_sprite_font_character_widths[] = {
21-
6, // 32
22-
4, // 33 !
23-
7, // 34 "
24-
8, // 35 #
25-
8, // 36 $
26-
7, // 37 %
27-
8, // 38 &
28-
4, // 39 '
29-
5, // 40 (
30-
5, // 41 )
31-
7, // 42 *
32-
7, // 43 +
33-
4, // 44 ,
34-
7, // 45 -
35-
4, // 46 .
36-
7, // 47 /
37-
7, // 48 0
38-
4, // 49 1
39-
7, // 50 2
40-
7, // 51 3
41-
7, // 52 4
42-
7, // 53 5
43-
7, // 54 6
44-
7, // 55 7
45-
7, // 56 8
46-
7, // 57 9
47-
4, // 58 :
48-
4, // 59 ;
49-
6, // 60 <
50-
7, // 61 =
51-
6, // 62 >
52-
7, // 63 ?
53-
8, // 64 @
54-
7, // 65 A
55-
7, // 66 B
56-
7, // 67 C
57-
7, // 68 D
58-
7, // 69 E
59-
7, // 70 F
60-
7, // 71 G
61-
7, // 72 H
62-
5, // 73 I
63-
7, // 74 J
64-
7, // 75 K
65-
7, // 76 L
66-
8, // 77 M
67-
7, // 78 N
68-
7, // 79 O
69-
7, // 80 P
70-
8, // 81 Q
71-
7, // 82 R
72-
7, // 83 S
73-
7, // 84 T
74-
7, // 85 U
75-
7, // 86 V
76-
8, // 87 W
77-
7, // 88 X
78-
7, // 89 Y
79-
7, // 90 Z
80-
5, // 91 [
81-
7, // 92
82-
5, // 93 ]
83-
4, // 94 ^
84-
7, // 95 _
85-
4, // 96 `
86-
7, // 97 a
87-
7, // 98 b
88-
7, // 99 c
89-
7, // 100 d
90-
7, // 101 e
91-
6, // 102 f
92-
7, // 103 g
93-
7, // 104 h
94-
3, // 105 i
95-
4, // 106 j
96-
6, // 107 k
97-
3, // 108 l
98-
8, // 109 m
99-
7, // 110 n
100-
7, // 111 o
101-
7, // 112 p
102-
7, // 113 q
103-
6, // 114 r
104-
7, // 115 s
105-
6, // 116 t
106-
7, // 117 u
107-
7, // 118 v
108-
8, // 119 w
109-
7, // 120 x
110-
7, // 121 y
111-
7, // 122 z
112-
6, // 123 {
113-
3, // 124 |
114-
6, // 125 }
115-
8, // 126 ~
116-
7, // Á
117-
7, // É
118-
5, // Í
119-
7, // Ó
120-
7, // Ú
121-
7, // Ü
122-
7, // Ñ
123-
7, // á
124-
7, // é
125-
4, // í
126-
7, // ó
127-
7, // ú
128-
7, // ü
129-
7, // ñ
130-
3, // ¡
131-
7, // ¿
20+
6, // 32
21+
4, // 33 !
22+
7, // 34 "
23+
8, // 35 #
24+
8, // 36 $
25+
7, // 37 %
26+
8, // 38 &
27+
4, // 39 '
28+
5, // 40 (
29+
5, // 41 )
30+
7, // 42 *
31+
7, // 43 +
32+
4, // 44 ,
33+
7, // 45 -
34+
4, // 46 .
35+
7, // 47 /
36+
7, // 48 0
37+
4, // 49 1
38+
7, // 50 2
39+
7, // 51 3
40+
7, // 52 4
41+
7, // 53 5
42+
7, // 54 6
43+
7, // 55 7
44+
7, // 56 8
45+
7, // 57 9
46+
4, // 58 :
47+
4, // 59 ;
48+
6, // 60 <
49+
7, // 61 =
50+
6, // 62 >
51+
7, // 63 ?
52+
8, // 64 @
53+
7, // 65 A
54+
7, // 66 B
55+
7, // 67 C
56+
7, // 68 D
57+
7, // 69 E
58+
7, // 70 F
59+
7, // 71 G
60+
7, // 72 H
61+
5, // 73 I
62+
7, // 74 J
63+
7, // 75 K
64+
7, // 76 L
65+
8, // 77 M
66+
7, // 78 N
67+
7, // 79 O
68+
7, // 80 P
69+
8, // 81 Q
70+
7, // 82 R
71+
7, // 83 S
72+
7, // 84 T
73+
7, // 85 U
74+
7, // 86 V
75+
8, // 87 W
76+
7, // 88 X
77+
7, // 89 Y
78+
7, // 90 Z
79+
5, // 91 [
80+
7, // 92
81+
5, // 93 ]
82+
4, // 94 ^
83+
7, // 95 _
84+
4, // 96 `
85+
7, // 97 a
86+
7, // 98 b
87+
7, // 99 c
88+
7, // 100 d
89+
7, // 101 e
90+
6, // 102 f
91+
7, // 103 g
92+
7, // 104 h
93+
3, // 105 i
94+
4, // 106 j
95+
6, // 107 k
96+
3, // 108 l
97+
8, // 109 m
98+
7, // 110 n
99+
7, // 111 o
100+
7, // 112 p
101+
7, // 113 q
102+
6, // 114 r
103+
7, // 115 s
104+
6, // 116 t
105+
7, // 117 u
106+
7, // 118 v
107+
8, // 119 w
108+
7, // 120 x
109+
7, // 121 y
110+
7, // 122 z
111+
6, // 123 {
112+
3, // 124 |
113+
6, // 125 }
114+
8, // 126 ~
115+
7, // Á
116+
7, // É
117+
5, // Í
118+
7, // Ó
119+
7, // Ú
120+
7, // Ü
121+
7, // Ñ
122+
7, // á
123+
7, // é
124+
4, // í
125+
7, // ó
126+
7, // ú
127+
7, // ü
128+
7, // ñ
129+
3, // ¡
130+
7, // ¿
132131
};
133132

134133
constexpr bn::span<const bn::utf8_character> variable_8x16_sprite_font_utf8_characters_span(
135-
variable_8x16_sprite_font_utf8_characters);
134+
variable_8x16_sprite_font_utf8_characters);
136135

137136
constexpr auto variable_8x16_sprite_font_utf8_characters_map =
138-
bn::utf8_characters_map<variable_8x16_sprite_font_utf8_characters_span>();
137+
bn::utf8_characters_map<variable_8x16_sprite_font_utf8_characters_span>();
139138

140-
constexpr bn::sprite_font variable_8x16_sprite_font(
141-
bn::sprite_items::common_variable_8x16_font, variable_8x16_sprite_font_utf8_characters_map.reference(),
142-
variable_8x16_sprite_font_character_widths);
139+
constexpr bn::sprite_font variable_8x16_sprite_font(bn::sprite_items::common_variable_8x16_font,
140+
variable_8x16_sprite_font_utf8_characters_map.reference(),
141+
variable_8x16_sprite_font_character_widths);
143142

144-
}
143+
} // namespace common
145144

146145
#endif

0 commit comments

Comments
 (0)