From: Christian Heller Date: Sat, 16 Mar 2024 21:36:34 +0000 (+0100) Subject: Add small script for setting up a proper development environment. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/error?a=commitdiff_plain;h=fe9b4953b3919439e8d261e76eae14349154c055;p=plomtask Add small script for setting up a proper development environment. --- diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit deleted file mode 100755 index a053262..0000000 --- a/git_hooks/pre-commit +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -e -python3 -m mypy task.py -python3 -m flake8 task.py -python3 -m pylint --good-names 'do_GET,do_POST' task.py -exit 0 diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..a053262 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +python3 -m mypy task.py +python3 -m flake8 task.py +python3 -m pylint --good-names 'do_GET,do_POST' task.py +exit 0 diff --git a/scripts/setup_dev_environment.sh b/scripts/setup_dev_environment.sh new file mode 100755 index 0000000..8ea3a44 --- /dev/null +++ b/scripts/setup_dev_environment.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +if [ ! -d '.git' ]; then + echo "Cannot find .git/, please run me from your cloned repo's top directory!" +elif [ ! -f '.git/hooks/pre-commit' ]; then + echo 'Linking pre-commit hook.' + cd .git/hooks/ + ln -s ../../scripts/pre-commit +fi