<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-html" lang="x-western">
<div><a
 href="http://tarekziade.wordpress.com/2006/11/01/protecting-a-python-svn-code-base-with-the-pre-commit-hook/">http://tarekziade.wordpress.com/2006/11/01/protecting-a-python-svn-code-base-with-the-pre-commit-hook/</a>
<br>
<br>
Is it possible to check code in python before committing to svn</div>
<div>&nbsp;</div>
<div>using pyflakes, pythontidy</div>
<div><br>
<b>Pyflakes and Subversion</b> </div>
<p><a href="http://www.divmod.org/projects/pyflakes">Pyflakes</a> 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 <a
 href="http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/enforcer/enforcer">enforcer</a>
pre-commit 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: </p>
<pre>$ svn ci -m "fix" completion.py
Sending        completion.py
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/completion.py:1: undefined name 'test'
</pre>
<p>The small "configuration" file for enforce can be found <a
 href="http://www.async.com.br/%7Ejdahlin/misc/enforcer.conf">here</a>.
</p>
Can you share enforcer file? or a means to ensure safe code in python
repo<br>
</div>
</body>
</html>