@@ -0,0 +1,841 @@
+#!/usr/bin/env python%0A%0A# Make a reST file compliant to our pre-commit hook.%0A# Currently just remove trailing whitespace.%0A%0Afrom __future__ import with_statement%0Aimport sys, re, shutil%0A%0Aws_re = re.compile(r'%5Cs+(%5Cr?%5Cn)$')%0A%0Adef main(argv=sys.argv):%0A    rv = 0%0A    for filename in argv%5B1:%5D:%0A        try:%0A            with open(filename, 'rb') as f:%0A                lines = f.readlines()%0A            new_lines = %5Bws_re.sub(r'%5C1', line) for line in lines%5D%0A            if new_lines != lines:%0A                print 'Fixing %25s...' %25 filename%0A            shutil.copyfile(filename, filename + '.bak')%0A            with open(filename, 'wb') as f:%0A                f.writelines(new_lines)%0A        except Exception, err:%0A            print 'Cannot fix %25s: %25s' %25 (filename, err)%0A            rv = 1%0A    return rv%0A%0Aif __name__ == '__main__':%0A    sys.exit(main())%0A

Add a script to fixup rst files if the pre-commit hook rejects them.