Skip to content

Commit

Permalink
Run format-text on keyboard PRs (qmk#19656)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and omikronik committed Jan 22, 2023
1 parent 906b539 commit 5a7a2ab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
QMK_KEYBOARDS=$(qmk list-keyboards)
exit_code=0
for KB in $QMK_KEYBOARDS; do
KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)')
if [[ -z "$KEYBOARD_CHANGES" ]]; then
Expand All @@ -54,6 +55,16 @@ jobs:
exit_code=$(($exit_code + $?))
fi
done
qmk format-text ${{ steps.file_changes.outputs.all_changed_files}} || true
for file in ${{ steps.file_changes.outputs.all_changed_files}}; do
if ! git diff --quiet $file; then
echo "File '${file}' Requires Formatting"
echo "::error file=${file}::Requires Formatting"
exit_code=$(($exit_code + 1))
fi
done
if [[ $exit_code -gt 255 ]]; then
exit 255
fi
Expand Down

0 comments on commit 5a7a2ab

Please sign in to comment.