anti-tab thing, Re: [Twisted-Python] Re: [Twisted-commits] r16495
corydodt at twistedmatrix.com
Wed Mar 29 12:35:03 EST 2006
-----BEGIN PGP SIGNED MESSAGE-----
In case you've never encountered a pre-commit hook, here's a sample of the
cory ~/wc/vellum% echo ' ' > foo.py
cory ~/wc/vellum% svn add foo.py
cory ~/wc/vellum% svn ci -m "i did not read the coding standard" foo.py
Transmitting file data .svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
Python file contains lines that begin with tabs: 'trunk/foo.py'
There may be others as well.
If Twisted wanted to adopt this, I would suggest adding a link to the coding
standard in this message, or something.
Cory Dodt wrote:
> For general discussion, I have attached a pre-commit hook that rejects commits
> of .py files containing leading tabs on any line. It does not do anything to
> files not ending in .py. It does check for tabs mixed with spaces. It
> ignores tabs occurring anywhere but the leading whitespace. Here's the regex:
> _tabs = re.compile(r'^\s*\t\s*.*$')
> I have used this, albeit lightly.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Twisted-Python