Skip to content

Commit 9743ff2

Browse files
committed
dev: make check-format-py.sh call check-format.sh
1 parent 9301eeb commit 9743ff2

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

dev/check-format-py.sh

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
11
#!/usr/bin/env bash
22

3-
clean=$(git status -s -uno | wc -l) #Short ignore untracked
4-
5-
if [ $clean -ne 0 ]; then
6-
echo "Current working tree was not clean! This tool only works on clean checkouts"
7-
exit 2
8-
else
9-
echo "Code Formatting Check"
10-
echo "====================="
11-
make format-py > /dev/null 2>&1
12-
13-
valid_format=$(git diff | wc -l)
14-
15-
if [ $valid_format -ne 0 ]; then
16-
echo "FAILED"
17-
echo ""
18-
echo "You *must* make the following changes to match the formatting style"
19-
echo "-------------------------------------------------------------------"
20-
echo ""
21-
22-
git diff
23-
24-
echo ""
25-
echo "Run 'make format-py' to apply these changes"
26-
27-
git reset --hard > /dev/null
28-
exit 1
29-
else
30-
echo "OK"
31-
fi
32-
fi
33-
exit 0
3+
$(dirname "$0")/check-format.sh -py

dev/check-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ $clean -ne 0 ]; then
88
else
99
echo "Code Formatting Check"
1010
echo "====================="
11-
make format > /dev/null
11+
make format"$1" > /dev/null 2>&1
1212

1313
valid_format=$(git diff | wc -l)
1414

@@ -22,7 +22,7 @@ else
2222
git diff
2323

2424
echo ""
25-
echo "Run 'make format' to apply these changes"
25+
echo "Run 'make format$1' to apply these changes"
2626

2727
git reset --hard > /dev/null
2828
exit 1

0 commit comments

Comments
 (0)