Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatted headers and added style check. #212

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
BasedOnStyle: Mozilla
Language: Cpp
ColumnLimit: 100
AlignAfterOpenBracket: AlwaysBreak
IndentWidth: 4
ContinuationIndentWidth: 4
PointerAlignment: Middle
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
SortIncludes: false
BraceWrapping:
AfterFunction: true
BreakBeforeBraces: Custom

15 changes: 15 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: style-checks
on: [push, pull_request]
jobs:
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: sudo apt-get update
- run: sudo apt-get install -y clang-format
- name: run git-clang-format
run: clang-format --style=file --dry-run --Werror `git ls-files *.c *.h` >clang-format-diff 2>&1
shell: bash
- name: output clang format diff
if: always()
run: cat ./clang-format-diff
Loading