Skip to content

Commit d58f993

Browse files
authored
Merge pull request #1813 from umarcor/dev-cleanup
dev scripts should not depend on ci scripts
2 parents 7554512 + 9743ff2 commit d58f993

File tree

2 files changed

+3
-37
lines changed

2 files changed

+3
-37
lines changed

dev/check-format-py.sh

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

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

dev/check-format.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
22

3-
source $(dirname "$0")/../.github/scripts/common.sh
4-
53
clean=$(git status -s -uno | wc -l) #Short ignore untracked
64

75
if [ $clean -ne 0 ]; then
@@ -10,7 +8,7 @@ if [ $clean -ne 0 ]; then
108
else
119
echo "Code Formatting Check"
1210
echo "====================="
13-
make format > /dev/null
11+
make format"$1" > /dev/null 2>&1
1412

1513
valid_format=$(git diff | wc -l)
1614

@@ -24,7 +22,7 @@ else
2422
git diff
2523

2624
echo ""
27-
echo "Run 'make format' to apply these changes"
25+
echo "Run 'make format$1' to apply these changes"
2826

2927
git reset --hard > /dev/null
3028
exit 1

0 commit comments

Comments
 (0)