aboutsummaryrefslogtreecommitdiff
path: root/test/ws_scan.sh
blob: 46b8a398349dcf9ad5b9d196c4d67b1ede0acaa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!bash

# checks for mixed indentation and empty lines with whitespace
# run from test/

cd ..
grep -lHIrP --include=*.{h,c} -- '^((\t+ +)|( +\t+)|\s+$)' | sed 's/^/- [ ] /' > test/hardinfo-bad.txt
grep -LHIrP --include=*.{h,c} -- '^((\t+ +)|( +\t+)|\s+$)' | sed 's/^/- [x] /' > test/hardinfo-good.txt
cat test/hardinfo-bad.txt test/hardinfo-good.txt | LC_ALL=C sort -k 1.5 | grep -vP " (test|build)"
rm test/hardinfo-bad.txt test/hardinfo-good.txt
cd test