kopia lustrzana https://github.com/inkstitch/inkstitch
only check style on lines changed by commit
rodzic
f4e1bbc7d7
commit
1140be3cef
|
@ -9,14 +9,9 @@
|
||||||
|
|
||||||
cd $(dirname "$0")/../..
|
cd $(dirname "$0")/../..
|
||||||
|
|
||||||
IFS=$'\n'
|
errors=$(git diff --cached | bin/style-check --diff 2>&1)
|
||||||
files=( $(git diff-index --cached --name-only --diff-filter=AMCR HEAD) )
|
|
||||||
|
|
||||||
if [ "${#files}" -gt 0 ]; then
|
if [ "$?" != "0" ]; then
|
||||||
errors=$(bin/style-check "${files[@]}" 2>&1)
|
echo "$errors"
|
||||||
|
exit 1
|
||||||
if [ "$?" != "0" ]; then
|
|
||||||
echo "$errors"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,5 +2,7 @@
|
||||||
|
|
||||||
# Checks Python coding style based on our project's preferences. Checks the
|
# Checks Python coding style based on our project's preferences. Checks the
|
||||||
# files passed on the command-line or everything if no files are passed.
|
# files passed on the command-line or everything if no files are passed.
|
||||||
|
# Instead of files, "--diff" may be passed to check only the lines changed
|
||||||
|
# by a diff piped to standard input.
|
||||||
|
|
||||||
flake8 --count --max-complexity=10 --max-line-length=150 --statistics --exclude=pyembroidery,__init__.py,electron,build,src,dist "${@:-.}"
|
flake8 --count --max-complexity=10 --max-line-length=150 --statistics --exclude=pyembroidery,__init__.py,electron,build,src,dist "${@:-.}"
|
||||||
|
|
Ładowanie…
Reference in New Issue