From f24b329ef5994d09b1ecba996c439150e3af8195 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 28 Apr 2022 22:37:34 -0400 Subject: pre-commit hook that only checks modifed files --- bin/style-check | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/style-check (limited to 'bin/style-check') diff --git a/bin/style-check b/bin/style-check new file mode 100755 index 00000000..ead4d553 --- /dev/null +++ b/bin/style-check @@ -0,0 +1,6 @@ +#!/bin/bash + +# 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. + +flake8 --count --max-complexity=10 --max-line-length=150 --statistics --exclude=pyembroidery,__init__.py,electron,build,src,dist "${@:-.}" -- cgit v1.2.3 From 1140be3cefcf070b03fd219c64a1f015db5ef510 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 28 Apr 2022 22:53:19 -0400 Subject: only check style on lines changed by commit --- bin/style-check | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin/style-check') diff --git a/bin/style-check b/bin/style-check index ead4d553..bafd6e74 100755 --- a/bin/style-check +++ b/bin/style-check @@ -2,5 +2,7 @@ # 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. +# 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 "${@:-.}" -- cgit v1.2.3