Skip to content

Commit e8f9ef4

Browse files
Merge pull request #6 from aut0/ci
Add clang-format workflow
2 parents 56cc463 + bf292a0 commit e8f9ef4

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/style.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: style
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
style:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Check code style
15+
run: ./utils/check_format.sh -n

utils/check_format.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
##############################################################################
4+
# #
5+
# Copyright 2022 Lukas Jünger #
6+
# #
7+
# Licensed under the Apache License, Version 2.0 (the "License"); #
8+
# you may not use this file except in compliance with the License. #
9+
# You may obtain a copy of the License at #
10+
# #
11+
# http://www.apache.org/licenses/LICENSE-2.0 #
12+
# #
13+
# Unless required by applicable law or agreed to in writing, software #
14+
# distributed under the License is distributed on an "AS IS" BASIS, #
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
16+
# See the License for the specific language governing permissions and #
17+
# limitations under the License. #
18+
# #
19+
##############################################################################
20+
21+
source=$(find -name "*.h" -or -name "*.hpp" -or -name "*.c" -or -name "*.cc" -or -name "*.cpp")
22+
exec clang-format --Werror $source $@

0 commit comments

Comments
 (0)