alexcouper / captainhook

Git hook scripts
BSD 3-Clause "New" or "Revised" License
54 stars 14 forks source link

[RFC] Use Python executable at install time to run pre-commit hook #26

Closed OddBloke closed 10 years ago

OddBloke commented 10 years ago

This means that the flake8 checker continues working for me outside of the virtualenv.

The only downside to this approach I can think of is that it might produce unexpected results if people remove virtualenvs or switch between them for the same project.

alexcouper commented 10 years ago

I like it. Though I think this should not be the default behaviour as it's rather unorthodox - but should be provided for through command line args during install.

This would give the user 3 options of using flake8.

  1. Run git commit from within a virtualenv carrying flake8.
  2. Install flake8 globally.
  3. Run captainhook from within a virtualenv carrying flake8, with the --use-current-venv flag (or similar)
OddBloke commented 10 years ago

Have updated this to only happen if -e/--use-virtualenv-python is given on the command line.

alexcouper commented 10 years ago

Nice, i'll test this out later on.

alexcouper commented 10 years ago

Going to merge and make these changes (along with a sed change for mac). Could you retest from master that I haven't broken your world?

Thanks!

OddBloke commented 10 years ago

Looks like it's working fine for me still.