alexcouper / captainhook

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

Pep8radius checker #98

Closed mknecht closed 4 years ago

mknecht commented 8 years ago

Check PEP-8 errors, but only in the diff.

Arguments are passed verbatim to pep8radius.

See pep8radius on GitHub: https://github.com/hayd/pep8radius

Addresses issue #95

alexcouper commented 8 years ago

This doesn't work for me locally.

I receive the following error in the output when I try to commit:

===============================================================================
Checking pep8radius
===============================================================================
Unknown version control system, or you're not in the project directory.

I believe the reason for the error is that (after https://github.com/alexcouper/captainhook/issues/36), we copy all the files that have changed out to a temporary directory and analyse them there.

The source of this error is this func. If I print out cwd in there at commit point, I can see that I am indeed getting some temporary folder location: /private/var/folders/6b/ql76gbpn0wz53q4hl2bxg6lw0000gn/T/tmphsqImz. (as you can see I'm running osx).

Do you get this behaviour?

mknecht commented 8 years ago

@alexcouper Ha, this is embarrassing. Yes, it can't work at the moment — i must have only checked that pep8radius works, and the commit is rejected, without checking why. Sorry about that.

Any idea on how to resolve that? Maybe have checkers choose, opt in to work on the original directory?