Browse Source

Fix ignore_path_errors call in main

The `parse_ignore_path_errors' function expects a list of paths, not an
individual path.

Change-Id: Icc8a4721b38776d8268c731ea5b624a3e4a3b2a9
Julien Danjou 2 years ago
parent
commit
f612f0e508
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      doc8/main.py

+ 6
- 7
doc8/main.py View File

@@ -342,13 +342,12 @@ def main():
342 342
     args['ignore_path'].extend(cfg.pop('ignore_path', []))
343 343
 
344 344
     cfg.setdefault('ignore_path_errors', {})
345
-    for tmp_ignore_path_error in args.pop('ignore_path_errors', []):
346
-        tmp_ignores = parse_ignore_path_errors(tmp_ignore_path_error)
347
-        for path, ignores in six.iteritems(tmp_ignores):
348
-            if path in cfg['ignore_path_errors']:
349
-                cfg['ignore_path_errors'][path].update(ignores)
350
-            else:
351
-                cfg['ignore_path_errors'][path] = set(ignores)
345
+    tmp_ignores = parse_ignore_path_errors(args.pop('ignore_path_errors', []))
346
+    for path, ignores in six.iteritems(tmp_ignores):
347
+        if path in cfg['ignore_path_errors']:
348
+            cfg['ignore_path_errors'][path].update(ignores)
349
+        else:
350
+            cfg['ignore_path_errors'][path] = set(ignores)
352 351
 
353 352
     args.update(cfg)
354 353
     setup_logging(args.get('verbose'))

Loading…
Cancel
Save