Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 5 additions and 5 deletions.
  1. +5 −5 pre-commit
View
10 pre-commit
@@ -7,7 +7,7 @@ Checks your git commit with JSHint. Only checks staged files
"""
def jshint():
- results = []
+ errors = []
# get all staged files
f = os.popen('git diff-index --name-only --cached HEAD')
@@ -17,12 +17,12 @@ def jshint():
# add all errors from all files together
for error in g.readlines():
- results.append(error)
+ errors.append(error)
# got errors?
- if results:
- for i, v in enumerate(results):
- print '\033[0;31m' + v + '\033[0m',
+ if errors:
+ for i, error in enumerate(errors):
+ print error,
# Abort the commit
sys.exit(1)

No commit comments for this range

Something went wrong with that request. Please try again.