From acc20844cd67f13c2fe586019068283687057f05 Mon Sep 17 00:00:00 2001 From: jLynx Date: Mon, 15 May 2023 11:53:13 +1200 Subject: [PATCH] Added clang formatting spec and PR validation (#992) * Update .clang-format --- .clang-format | 7 +++++++ .github/workflows/check_formatting.yml | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .clang-format create mode 100644 .github/workflows/check_formatting.yml diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..1e62ea11 --- /dev/null +++ b/.clang-format @@ -0,0 +1,7 @@ +--- +BasedOnStyle: Chromium +IndentWidth: '2' +TabWidth: '2' +UseTab: Always + +... diff --git a/.github/workflows/check_formatting.yml b/.github/workflows/check_formatting.yml new file mode 100644 index 00000000..6a891d6c --- /dev/null +++ b/.github/workflows/check_formatting.yml @@ -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