Added clang formatting spec and PR validation (#992)

* Update .clang-format
This commit is contained in:
jLynx 2023-05-15 11:53:13 +12:00 committed by GitHub
parent e694e73a75
commit acc20844cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

7
.clang-format Normal file
View File

@ -0,0 +1,7 @@
---
BasedOnStyle: Chromium
IndentWidth: '2'
TabWidth: '2'
UseTab: Always
...

18
.github/workflows/check_formatting.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Check formatting
on: #[push, pull_request] To be enabled once formatting is fixed in repo
workflow_dispatch:
jobs:
check_date:
runs-on: ubuntu-latest
name: Check formatting
steps:
- uses: actions/checkout@v2
- name: print latest_commit
run: echo ${{ github.sha }}
- name: clang-format Check
uses: jidicula/clang-format-action@v4.11.0
with:
check-path: "firmware"
fallback-style: Chromium