Skip to content

Commit 899c81c

Browse files
committed
fix(ci): run clang-format on .hpp
1 parent 0817e9c commit 899c81c

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

.github/workflows/cpp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
paths:
66
- "**/*.cpp"
7-
- "**/*.h"
7+
- "**/*.hpp"
88
pull_request:
99
paths:
1010
- "**/*.cpp"
11-
- "**/*.h"
11+
- "**/*.hpp"
1212

1313
jobs:
1414
format:
@@ -22,4 +22,4 @@ jobs:
2222
with:
2323
clangformat: 18.1.6
2424
- name: Run clang-format
25-
run: clang-format **/*.cpp **/*.h -n --Werror
25+
run: clang-format **/*.cpp **/*.hpp -n --Werror

tools/debugger/debug.hpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ using namespace std;
1111
#define debug(...) \
1212
{ \
1313
_print_header(__FILE__, __LINE__, __FUNCTION__); \
14-
string _s = #__VA_ARGS__; \
15-
replace(_s.begin(), _s.end(), ',', ' '); \
16-
stringstream _ss(_s); \
17-
istream_iterator<string> _it(_ss); \
14+
string _s = #__VA_ARGS__; \
15+
replace(_s.begin(), _s.end(), ',', ' '); \
16+
stringstream _ss(_s); \
17+
istream_iterator<string> _it(_ss); \
1818
_print_value(_it, __VA_ARGS__); \
1919
}
2020

@@ -84,8 +84,7 @@ template <class T>
8484
struct is_supports_top<priority_queue<T>> : true_type {};
8585

8686
template <class T>
87-
struct is_supports_top<priority_queue<T, vector<T>, greater<T>>>
88-
: true_type {};
87+
struct is_supports_top<priority_queue<T, vector<T>, greater<T>>> : true_type {};
8988

9089
template <class T>
9190
struct is_implemented {
@@ -108,8 +107,7 @@ string to_string(const char *s) { return to_string((string)s); }
108107
string to_string(bool b) { return (b ? "true" : "false"); }
109108

110109
template <class T>
111-
typename enable_if<filter::is_iterable<T>::value, string>::type
112-
to_string(T v) {
110+
typename enable_if<filter::is_iterable<T>::value, string>::type to_string(T v) {
113111
bool first = true;
114112
string res = CONTAINER + "{ ";
115113
for (auto &x : v) {
@@ -121,9 +119,7 @@ to_string(T v) {
121119
}
122120

123121
template <class T>
124-
typename enable_if<filter::is_map<T>::value, string>::type to_string(
125-
T m
126-
) {
122+
typename enable_if<filter::is_map<T>::value, string>::type to_string(T m) {
127123
bool first = true;
128124
string res = CONTAINER + "{ ";
129125
for (auto &[k, v] : m) {
@@ -136,8 +132,9 @@ typename enable_if<filter::is_map<T>::value, string>::type to_string(
136132
}
137133

138134
template <class T>
139-
typename enable_if<filter::is_supports_top<T>::value, string>::type
140-
to_string(T v) {
135+
typename enable_if<filter::is_supports_top<T>::value, string>::type to_string(
136+
T v
137+
) {
141138
T t = v;
142139
bool first = true;
143140
string res = CONTAINER + "{ ";
@@ -188,8 +185,9 @@ string to_string(tuple<T...> t) {
188185
}
189186

190187
template <class T>
191-
typename enable_if<!filter::is_implemented<T>::value, string>::type
192-
to_string(T x) {
188+
typename enable_if<!filter::is_implemented<T>::value, string>::type to_string(
189+
T x
190+
) {
193191
return ERROR + "Not implemented" + RESET;
194192
}
195193

@@ -200,7 +198,7 @@ string _to_str(T x) {
200198

201199
void _print_header(string file, int line, string func) {
202200
cerr << HEADER << "[" << file << ":" << line
203-
<< (func == "main" ? "" : " - " + func) << "]" << RESET << "\n";
201+
<< (func == "main" ? "" : " - " + func) << "]" << RESET << "\n";
204202
}
205203

206204
void _print_value(istream_iterator<string> it) {}

0 commit comments

Comments
 (0)