Skip to content

Commit 88800a0

Browse files
committed
apply fix-format
1 parent 1924153 commit 88800a0

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

.github/workflows/style.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Style
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
13+
env:
14+
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- uses: actions/cache@v3
24+
with:
25+
path: "**/cpm_modules"
26+
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
27+
28+
- name: Before Install
29+
run: |
30+
sudo apt-get install g++-10
31+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 90
32+
33+
- name: Install format dependencies
34+
run: pip3 install clang-format==18.1.2 cmake_format==0.6.13 pyyaml
35+
36+
- name: configure
37+
run: cmake -Stest -Bbuild
38+
39+
- name: check style
40+
run: cmake --build build --target check-format

include/py2cpp/dict.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ namespace py {
185185
* @return true
186186
* @return false
187187
*/
188-
template <typename Key, typename T>
189-
inline auto operator<(const Key &key, const dict<Key, T> &m) -> bool {
188+
template <typename Key, typename T> inline auto operator<(const Key &key, const dict<Key, T> &m)
189+
-> bool {
190190
return m.contains(key);
191191
}
192192

include/py2cpp/enumerate.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ namespace py {
133133
* @param[in] iterable
134134
* @return detail::EnumerateIterableWrapper<T>
135135
*/
136-
template <typename T>
137-
inline auto enumerate(T &iterable) -> detail::EnumerateIterableWrapper<T> {
136+
template <typename T> inline auto enumerate(T &iterable)
137+
-> detail::EnumerateIterableWrapper<T> {
138138
return detail::EnumerateIterableWrapper<T>{iterable};
139139
}
140140

@@ -152,8 +152,8 @@ namespace py {
152152
* @param[in] iterable
153153
* @return detail::EnumerateIterableWrapper<const T>
154154
*/
155-
template <typename T>
156-
inline auto const_enumerate(const T &iterable) -> detail::EnumerateIterableWrapper<const T> {
155+
template <typename T> inline auto const_enumerate(const T &iterable)
156+
-> detail::EnumerateIterableWrapper<const T> {
157157
return detail::EnumerateIterableWrapper<const T>{iterable};
158158
}
159159

include/py2cpp/fractions.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ namespace fun {
734734
* @param[in] frac
735735
* @return _Stream&
736736
*/
737-
template <typename _Stream>
738-
friend auto operator<<(_Stream &os, const Fraction &frac) -> _Stream & {
737+
template <typename _Stream> friend auto operator<<(_Stream &os, const Fraction &frac)
738+
-> _Stream & {
739739
os << "(" << frac.num() << "/" << frac.den() << ")";
740740
return os;
741741
}

0 commit comments

Comments
 (0)