summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-09-08 11:47:28 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-09-08 11:47:28 -0700
commit87bcf0bb32a2ac13865c801a10483054e65ed2cc (patch)
tree3a085d9a37612750c1e174d62b76d6aef43bedf3
parent355029419eabef896adc809dedb58951f03f4c8d (diff)
Just use get() instead of pop()
Now that these are functions we don't need to destroy the incoming configuration dictionary by popping things from it. Change-Id: I5d0ff032f0e7c9e79d39c3f5d533c43801502a8c
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Christian Berendt <berendt@b1-systems.de> Code-Review+2: Joshua Harlow <harlowja@yahoo-inc.com> Workflow+1: Joshua Harlow <harlowja@yahoo-inc.com> Submitted-by: Jenkins Submitted-at: Thu, 11 Sep 2014 20:08:33 +0000 Reviewed-on: https://review.openstack.org/119583 Project: stackforge/doc8 Branch: refs/heads/master
-rw-r--r--doc8/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc8/main.py b/doc8/main.py
index eaabdd1..a029723 100644
--- a/doc8/main.py
+++ b/doc8/main.py
@@ -151,10 +151,10 @@ def setup_logging(verbose):
151def scan(cfg): 151def scan(cfg):
152 print("Scanning...") 152 print("Scanning...")
153 files = collections.deque() 153 files = collections.deque()
154 ignored_paths = cfg.pop('ignore_path') 154 ignored_paths = cfg.get('ignore_path', [])
155 files_ignored = 0 155 files_ignored = 0
156 file_iter = utils.find_files(cfg.pop('paths', []), 156 file_iter = utils.find_files(cfg.get('paths', []),
157 cfg.pop('extension', []), ignored_paths) 157 cfg.get('extension', []), ignored_paths)
158 for filename, ignoreable in file_iter: 158 for filename, ignoreable in file_iter:
159 if ignoreable: 159 if ignoreable:
160 files_ignored += 1 160 files_ignored += 1
@@ -170,7 +170,7 @@ def scan(cfg):
170def validate(cfg, files): 170def validate(cfg, files):
171 print("Validating...") 171 print("Validating...")
172 error_counts = {} 172 error_counts = {}
173 ignoreables = frozenset(cfg.pop('ignore', [])) 173 ignoreables = frozenset(cfg.get('ignore', []))
174 while files: 174 while files:
175 f = files.popleft() 175 f = files.popleft()
176 if cfg.get('verbose'): 176 if cfg.get('verbose'):