forked from KallistiOS/KallistiOS
-
Notifications
You must be signed in to change notification settings - Fork 0
22 lines (19 loc) · 722 Bytes
/
Copy pathno-tab.yml
File metadata and controls
22 lines (19 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: No-tabulation check
on: pull_request
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: No-tabulation check
run: |
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
git diff ${{ github.base_ref }} -- . ':(exclude)*Makefile' ':(exclude)*.mk' | awk '
/^\+\+\+ / { f=$2; sub(/^b\//,"",f); next }
/^@@ / { match($0,/\+[0-9]+/); ln=substr($0,RSTART+1,RLENGTH-1)+0; next }
/^\+/ { if(index($0,"\t")){ printf "::error file=%s,line=%d::Tab character not allowed\n", f, ln; rc=1 } ln++; next }
/^[ ]/ { ln++ }
END { exit rc }
'