Pyflakes pre-commit hook in subversion

mobiledreamers at mobiledreamers at
Wed Jan 9 02:02:28 CET 2008

Is it possible to check code in python before committing to svn

using pyflakes, pythontidy

*Pyflakes and Subversion*

Pyflakes <> is a nice little utility
that checks your Python code for errors. The main advantage over PyChecker
and PyLint is that it is much faster and gives almost no false positives.
Today I wrote a little hack on top of the
script which forces the code you check in to pass pyflakes. Eg,
the users of svn will see the following output if they try to check in code
which has errors pyflakes can detect:

$ svn ci -m "fix"
Transmitting file data .svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
Pyflakes found 1 error(s)/warning(s):
kiwi/trunk/examples/ undefined name 'test'

The small "configuration" file for enforce can be found

Can you share enforcer file? or a means to ensure safe code in python repo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list