File tree Expand file tree Collapse file tree 1 file changed +13
-16
lines changed
Expand file tree Collapse file tree 1 file changed +13
-16
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- if git rev-parse --verify HEAD > /dev/null 2>&1
4- then
5- against=HEAD
3+ if git rev-parse --verify HEAD > /dev/null 2>&1 ; then
4+ against=HEAD
65else
7- # Initial commit: diff against an empty tree object
8- against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
6+ # Initial commit: diff against an empty tree object
7+ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
98fi
109
11- FILES=$( git diff-index --name-only --diff-filter=ACMR --cached $against -- | egrep " .py$" )
10+ FILES=$( git diff-index --name-only --diff-filter=ACMR --cached $against -- | egrep " .py$" )
1211if [ " $FILES " != " " ]; then
1312 # We want to look at the staged version only, so we have to run it once for
1413 # each file.
1514 E=0
1615 for F in ${FILES} ; do
16+ if ! git show " :$F " | ruff check - --quiet --stdin-filename " $F " ; then
17+ E=1
18+ fi
1719
18- if ! git show " :$F " | ruff check - --quiet --stdin-filename " $F " ; then
19- E=1
20- fi
21-
22- if ! git show " :$F " | ruff format - --quiet --check; then
23- E=1
24- echo " Formatting errors in $F , run 'make format'"
25- fi
20+ if ! git show " :$F " | ruff format - --quiet --check; then
21+ E=1
22+ echo " Formatting errors in $F , run 'make format'"
23+ fi
2624 done
2725 if [ " $E " != " 0" ]; then
28- exit 1
26+ exit 1
2927 fi
3028
3129 echo Basic python checks passed.
3230fi
33-
You can’t perform that action at this time.
0 commit comments