Skip to content

Commit

Permalink
build: Add clang-format style
Browse files Browse the repository at this point in the history
  • Loading branch information
freeekanayaka committed Mar 15, 2024
1 parent 1b38f42 commit 9ab7ad5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BasedOnStyle: Chromium
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
AfterStruct: true
IndentWidth: 4
PointerAlignment: Right
ForEachMacros: ['QUEUE_FOREACH']
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,17 @@ jobs:
- name: Test
run: |
make check CFLAGS=-O0 || (cat ./test-suite.log && false)
linting:
name: Linting
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.14
with:
source: 'src test'
exclude: 'test/lib/munit.*'
extensions: 'c,h'
clangFormatVersion: 14
style: file
3 changes: 2 additions & 1 deletion src/vr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../include/vr.h"

int vr_step(void) {
int vr_step(void)
{
return 0;
}

0 comments on commit 9ab7ad5

Please sign in to comment.