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