Commits

Alejandro Blanco  committed 6cafc43 Merge

Merge with hghooks from lgs

  • Participants
  • Parent commits d107483, dd6091e

Comments (0)

Files changed (1)

File hghooks/code.py

 
 
 def pep8_checker(ignore=''):
-    ignore_list = []
+    extra_args = []
     if ignore:
-        ignore_list = ['--ignore=%s' % ign.strip(',')
-                       for ign in ignore.split()
-                       if ign]
+        ignore_spec = ','.join([ign.strip(', ') for ign in ignore.split()
+                                if ign.strip(', ')])
+        extra_args.append('--ignore=%s' % ignore_spec)
 
     def check_pep8(files_to_check, msg):
         for filename, data in files_to_check.items():
 
         # monkey patch sys.argv options so we can call pep8
         old_args = sys.argv
-        sys.argv = ['pep8'] + files_to_check.keys() + ignore_list
+        sys.argv = ['pep8'] + files_to_check.keys() + extra_args
         options, args = pep8.process_options()
         sys.argv = old_args
         for path in args: