File tree Expand file tree Collapse file tree 2 files changed +3
-37
lines changed Expand file tree Collapse file tree 2 files changed +3
-37
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
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
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- source $( dirname " $0 " ) /../.github/scripts/common.sh
4
-
5
3
clean=$( git status -s -uno | wc -l) # Short ignore untracked
6
4
7
5
if [ $clean -ne 0 ]; then
@@ -10,7 +8,7 @@ if [ $clean -ne 0 ]; then
10
8
else
11
9
echo " Code Formatting Check"
12
10
echo " ====================="
13
- make format > /dev/null
11
+ make format" $1 " > /dev/null 2>&1
14
12
15
13
valid_format=$( git diff | wc -l)
16
14
24
22
git diff
25
23
26
24
echo " "
27
- echo " Run 'make format' to apply these changes"
25
+ echo " Run 'make format$1 ' to apply these changes"
28
26
29
27
git reset --hard > /dev/null
30
28
exit 1
You can’t perform that action at this time.
0 commit comments