diff options
| author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-11-08 23:00:55 +0800 |
|---|---|---|
| committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-11-08 23:34:56 +0800 |
| commit | 6595d3a08dedec4ff07683bf2c8f5aca2637fc5f (patch) | |
| tree | e4043b68484da311170d1c0994dad47d195b7a4c /src | |
| parent | 9553c8d8ccf54221153f498e28297d9cc74ca12d (diff) | |
| download | flake8-6595d3a08dedec4ff07683bf2c8f5aca2637fc5f.tar.gz | |
Add previous_unindented_logical_line attribute
This attribute is introduced in pycodestyle 2.1.0
Closes #246
See: https://github.com/PyCQA/pycodestyle/issues/400
Diffstat (limited to 'src')
| -rw-r--r-- | src/flake8/processor.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flake8/processor.py b/src/flake8/processor.py index 2757e8f..7cea038 100644 --- a/src/flake8/processor.py +++ b/src/flake8/processor.py @@ -41,6 +41,7 @@ class FileProcessor(object): - :attr:`noqa` - :attr:`previous_indent_level` - :attr:`previous_logical` + - :attr:`previous_unindented_logical_line` - :attr:`tokens` - :attr:`file_tokens` - :attr:`total_lines` @@ -89,6 +90,8 @@ class FileProcessor(object): self.previous_indent_level = 0 #: Previous logical line self.previous_logical = '' + #: Previous unindented (i.e. top-level) logical line + self.previous_unindented_logical_line = '' #: Current set of tokens self.tokens = [] #: Total number of lines in the file @@ -163,6 +166,8 @@ class FileProcessor(object): if self.logical_line: self.previous_indent_level = self.indent_level self.previous_logical = self.logical_line + if not self.indent_level: + self.previous_unindented_logical_line = self.logical_line self.blank_lines = 0 self.tokens = [] self.noqa = False |
