mirror of https://github.com/kivy/kivy.git
- updated pre-commit hook to work with other distros (eg. python 2 and 3 installed)
This commit is contained in:
parent
06ae7872c4
commit
e7b8df48e0
|
@ -88,9 +88,10 @@ but the fork you create with the following steps:
|
|||
the git remote name 'origin' and you will be on branch 'master'.
|
||||
#. Compile and set up PYTHONPATH or install (see :ref:`dev-install`).
|
||||
#. Install our pre-commit hook that ensures your code doesn't violate our
|
||||
styleguide by executing 'make hook' in your clone. This will run our
|
||||
styleguide check whenever you do a commit, and if there are violations in
|
||||
the parts that you changed, your commit will be aborted. Fix & retry.
|
||||
styleguide by executing `make hook` from the root directory of your
|
||||
clone. This will run our styleguide check whenever you do a commit,
|
||||
and if there are violations in the parts that you changed, your commit
|
||||
will be aborted. Fix & retry.
|
||||
|
||||
Now, whenever you want to create a patch, you follow the following steps:
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class KivyStyleChecker(pep8.Checker):
|
|||
line_number, offset, text, check)
|
||||
|
||||
# html generation
|
||||
print '<tr><td>%d</td><td>%s</td></tr>' % (line_number, text)
|
||||
print '<tr><td>{0}</td><td>{1}</td></tr>'.format(line_number, text)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python2
|
||||
|
||||
'''
|
||||
Kivy Git Pre-Commit Hook to Enforce Styleguide
|
||||
|
@ -32,7 +32,7 @@ proc = Popen(['git', 'diff', '--cached', '--name-only', 'HEAD'], stdout=PIPE)
|
|||
proc.wait()
|
||||
targets = [join(kivydir, target) for target in proc.stdout]
|
||||
call(['git', 'stash', 'save', '--keep-index', '--quiet'])
|
||||
retval = call(['python', script, srcdir] + targets)
|
||||
retval = call(['python2', script, srcdir] + targets)
|
||||
call(['git', 'stash', 'pop', '--quiet'])
|
||||
|
||||
if retval:
|
||||
|
|
Loading…
Reference in New Issue