Skip to content
Permalink
Browse files

[IMPROVEMENT] Clang format (#1222)

* Add .clang-format

* Add clang-format github action

* Set more explicit name to GitHub workflow

Co-Authored-By: Willem <github@canihavesome.coffee>

Co-authored-by: Willem <github@canihavesome.coffee>
  • Loading branch information
NilsIrl and canihavesomecoffee committed Jan 30, 2020
1 parent af6d828 commit 722d52420c32e0709f5e8ed1548a3e1d50f897a6
Showing with 25 additions and 0 deletions.
  1. +7 −0 .clang-format
  2. +16 −0 .github/workflows/format.yml
  3. +2 −0 src/thirdparty/.clang-format
@@ -0,0 +1,7 @@
BreakBeforeBraces: Allman
ColumnLimit: 0
IndentCaseLabels: true
IndentWidth: 8
TabWidth: 8
UseTab: Always
SortIncludes: false
@@ -0,0 +1,16 @@
name: Format sourcecode
on: [push, pull_request]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository -y 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
sudo apt install clang-format-9
- name: Format code
run: |
find src/ -type f -name '*.c' -name '*.c' | xargs clang-format-9 -i
git diff-index --quiet HEAD -- || (git diff && exit 1)
@@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: false

0 comments on commit 722d524

Please sign in to comment.
You can’t perform that action at this time.