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

Create pr-format-check.yml action #70

Merged
merged 29 commits into from
Mar 30, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bc846e6
Create pr-format-check.yml
Micnasr Mar 21, 2024
cb36611
testing github action
Micnasr Mar 23, 2024
ea6cfd5
Update pr-format-check.yml
Micnasr Mar 23, 2024
c0537d4
Update pr-format-check.yml
Micnasr Mar 23, 2024
6744189
changing file
Micnasr Mar 23, 2024
1d96732
Merge branch 'user/micnasr/format-check' of github.com:macformula/rac…
Micnasr Mar 23, 2024
cb03a1a
Update pr-format-check.yml
Micnasr Mar 23, 2024
834bf32
Update pr-format-check.yml
Micnasr Mar 23, 2024
b50dc9c
Update pr-format-check.yml
Micnasr Mar 23, 2024
29f493b
Update pr-format-check.yml
Micnasr Mar 23, 2024
f98b433
Update pr-format-check.yml
Micnasr Mar 23, 2024
21a204a
trying to get git clang to find a change
Micnasr Mar 26, 2024
711ea6c
Merge branch 'user/micnasr/format-check' of github.com:macformula/rac…
Micnasr Mar 26, 2024
3557d64
Update pr-format-check.yml
Micnasr Mar 26, 2024
0a9e061
Update pr-format-check.yml
Micnasr Mar 26, 2024
8b7c1a6
Update pr-format-check.yml
Micnasr Mar 26, 2024
f988dc3
trying to get git clang to find a change
Micnasr Mar 27, 2024
e6f1db4
removing useless file
Micnasr Mar 27, 2024
47257c6
Update pr-format-check.yml
Micnasr Mar 27, 2024
e75adff
Update pr-format-check.yml
Micnasr Mar 27, 2024
56d435f
trying to fix style reference in command
Micnasr Mar 27, 2024
5f0fd1e
attempting to fail the action if formatting is bad
Micnasr Mar 27, 2024
c55a6d0
Update pr-format-check.yml
Micnasr Mar 27, 2024
ba51a13
trying to see what no changes return in output
Micnasr Mar 27, 2024
2855188
new file but good formatting test
Micnasr Mar 27, 2024
c474ae7
new file but good formatting test
Micnasr Mar 27, 2024
01798b0
Update pr-format-check.yml
Micnasr Mar 27, 2024
6736eab
bad formatting test
Micnasr Mar 27, 2024
55a7b41
no changes final test
Micnasr Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/pr-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
pull_request:
branches:
- main

jobs:
clang_format_check:
name: Check Clang Format
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up clang-format
run: sudo apt-get install clang-format -y

- name: Fetch main branch
run: git fetch origin main:main

- name: Check code formatting
id: check_formatting
run: |
git clang-format --style=file:firmware/.clang-format --diff $(git merge-base HEAD main) -v > clang_format_output.txt
if grep -q "clang-format did not modify any files" clang_format_output.txt; then
echo "Code formatting is already correct."
elif grep -q "Running clang-format on the following files" clang_format_output.txt; then
echo "Code formatting changes detected."
exit 1
fi
Loading