summaryrefslogtreecommitdiff
path: root/flake8/processor.py
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-03-10 19:54:53 -0600
committerIan Cordasco <graffatcolmingov@gmail.com>2016-03-10 19:54:53 -0600
commit960f4d6af7cae10fefd5f67f9b0886b4e73021ed (patch)
treef5d0037d36bda590eaad28a910c3258db0bfc48f /flake8/processor.py
parentf04d8da485751bcc5fbdfccdfa6cb369019572af (diff)
downloadflake8-960f4d6af7cae10fefd5f67f9b0886b4e73021ed.tar.gz
Fix missing attributes for pep8 plugins
Diffstat (limited to 'flake8/processor.py')
-rw-r--r--flake8/processor.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/flake8/processor.py b/flake8/processor.py
index 88514e5..52d7ab1 100644
--- a/flake8/processor.py
+++ b/flake8/processor.py
@@ -57,6 +57,12 @@ class FileProcessor(object):
self.blank_before = 0
#: Number of blank lines
self.blank_lines = 0
+ #: Checker states for each plugin?
+ self._checker_states = {}
+ #: Current checker state
+ self.checker_state = None
+ #: User provided option for hang closing
+ self.hang_closing = options.hang_closing
#: Character used for indentation
self.indent_char = None
#: Current level of indentation
@@ -80,7 +86,7 @@ class FileProcessor(object):
#: Total number of lines in the file
self.total_lines = len(self.lines)
#: Verbosity level of Flake8
- self.verbosity = options.verbose
+ self.verbose = options.verbose
@contextlib.contextmanager
def inside_multiline(self, line_number):
@@ -110,6 +116,13 @@ class FileProcessor(object):
if self.blank_before < self.blank_lines:
self.blank_before = self.blank_lines
+ def update_checker_state_for(self, plugin):
+ """Update the checker_state attribute for the plugin."""
+ if 'checker_state' in plugin.parameters:
+ self.checker_state = self._checker_states.setdefault(
+ plugin.name, {}
+ )
+
def next_logical_line(self):
"""Record the previous logical line.