add pre-commit

This commit is contained in:
Robert Resch 2022-01-29 17:24:00 +01:00
parent ec3cb41dc0
commit bf2514cb09
14 changed files with 320 additions and 800 deletions

21
scripts/run-in-env.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -eu
# Activate pyenv and virtualenv if present, then run the specified command
# pyenv, pyenv-virtualenv
if [ -s .python-version ]; then
PYENV_VERSION=$(head -n 1 .python-version)
export PYENV_VERSION
fi
# other common virtualenvs
my_path=$(git rev-parse --show-toplevel)
for venv in venv .venv .; do
if [ -f "${my_path}/${venv}/bin/activate" ]; then
. "${my_path}/${venv}/bin/activate"
fi
done
exec "$@"