summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-distribution-archives3
-rwxr-xr-xbin/git-pre-commit-hook17
-rwxr-xr-xbin/style-check8
3 files changed, 27 insertions, 1 deletions
diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives
index a4129e83..c7973022 100755
--- a/bin/build-distribution-archives
+++ b/bin/build-distribution-archives
@@ -118,10 +118,11 @@ if [ "$BUILD" = "linux" ]; then
%_signature gpg
EOF
+ deb_version="$(sed -E 's/[^a-zA-Z0-9.+]/./g' <<< "$VERSION")"
fpm -s dir \
-t deb \
-n inkstitch \
- -v "$VERSION" \
+ -v "$deb_version" \
-d "inkscape >= 1.0.0" \
--license "GPL-3.0" \
--description "An open-source machine embroidery design platform based on Inkscape" \
diff --git a/bin/git-pre-commit-hook b/bin/git-pre-commit-hook
new file mode 100755
index 00000000..81ace2cd
--- /dev/null
+++ b/bin/git-pre-commit-hook
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# copy (DO NOT SYMLINK) this file to .git/hooks/pre-commit
+# to check style on all modified files before allowing the commit to complete
+#
+# DO NOT SYMLINK
+# DO NOT SYMLINK
+# DO NOT SYMLINK (why? security risk)
+
+cd $(dirname "$0")/../..
+
+errors=$(git diff --cached | bin/style-check --diff 2>&1)
+
+if [ "$?" != "0" ]; then
+ echo "$errors"
+ exit 1
+fi
diff --git a/bin/style-check b/bin/style-check
new file mode 100755
index 00000000..bafd6e74
--- /dev/null
+++ b/bin/style-check
@@ -0,0 +1,8 @@
+#!/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.
+# 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 "${@:-.}"