Permalink
Browse files

Get the precommit hook to run when a venv isn't active

Referencing the bin paths under venv as well as putting it onto the
path used by Make gets the hook working when invoked from magit.
  • Loading branch information...
lovett committed Jan 21, 2019
1 parent 80116ec commit ac7c3ce0d559f1ecde08662a1048d703324c6597
Showing with 4 additions and 2 deletions.
  1. +2 −0 Makefile
  2. +2 −2 hooks/pre-commit
@@ -37,6 +37,8 @@ PIP_OUTDATED_TEMP := temp-pip-outdated.txt
SHARED_JS_DIR := $(CURDIR)/apps/shared/static/js
TMUX_SESSION_NAME := medley

export PATH := ./venv/bin:$(PATH)

# Debugging tool to print the value of a variable.
#
# Example: make print-PLUGIN_DIR
@@ -24,8 +24,8 @@ for CHANGED_FILE in $(git diff --cached --name-only --diff-filter=dcr); do
TEST_FILE="${PARENT_PATH}/test_${FILE_NAME}.py"


flake8 "$CHANGED_FILE"
pylint --rcfile=.pylintrc "$CHANGED_FILE"
./venv/bin/flake8 "$CHANGED_FILE"
./venv/bin/pylint --rcfile=.pylintrc "$CHANGED_FILE"

if [ ! -f "$TEST_FILE" ]; then
continue

0 comments on commit ac7c3ce

Please sign in to comment.