summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-01-22 03:15:10 +0000
committerGitHub <noreply@github.com>2023-01-22 14:15:10 +1100
commit603c86b6a21dbcf3c2804ae70776ab042ee185ca (patch)
tree50c0b06068b2d78d62434089ea8f17e44a9e1b7d /.github/workflows
parent713003b7fdf2e313b60ece775477e8791e948e20 (diff)
Run format-text on keyboard PRs (#19656)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/lint.yml11
1 files changed, 11 insertions, 0 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 2bae44ae99..67d4093a0b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -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
@@ -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