Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't report trailing whitespace for json, #8

  • Loading branch information...
commit 4feb70f82b878da5ec5ec0563aebd9d1eec38c7b 1 parent 44797a5
@Pike Pike authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 check.py
View
8 check.py
@@ -38,13 +38,15 @@ def captured_output():
checkers = []
-def checker(include='*', exclude=''):
+def checker(include='*', excludes=[]):
"""Decorator to register `func` in `checkers` and normalize output."""
def decorator(func):
@functools.wraps(func)
def helper(files):
files = fnmatch.filter(files, include)
- files = [f for f in files if not fnmatch.fnmatch(f, exclude)]
+ for expattern in excludes:
+ files = [f for f in files
+ if not fnmatch.fnmatch(f, expattern)]
if not files:
return ""
return func(files).strip()
@@ -90,7 +92,7 @@ def pep8(files):
return call(['pep8', '--repeat'] + files)
-@checker(exclude='*.py')
+@checker(excludes=['*.py', '*.json'])
def trailing_whitespace(files):
output = []
r = re.compile('\s+$')
Please sign in to comment.
Something went wrong with that request. Please try again.