diff -r f96c32abd120 -r d39dd5cee0c8 Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py --- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Sun Sep 04 16:50:23 2016 +0200 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Sun Sep 04 17:16:38 2016 +0200 @@ -21,7 +21,7 @@ # CodeStyleCheckerDialog tries to import FixableCodeStyleIssues what fail under # Python3. So ignore it. try: - import pep8 + import pycodestyle except ImportError: pass @@ -1292,8 +1292,8 @@ line = line - 1 text = self.__source[line] - # This is necessary since pep8 sometimes reports columns that goes - # past the end of the physical line. This happens in cases like, + # This is necessary since pycodestyle sometimes reports columns that + # goes past the end of the physical line. This happens in cases like, # foo(bar\n=None) col = min(pos, len(text) - 1) if text[col].strip(): @@ -1491,7 +1491,7 @@ if not text.lstrip().startswith("import"): return (0, "", 0) - # pep8 (1.3.1) reports false positive if there is an import + # pycodestyle (1.3.1) reports false positive if there is an import # statement followed by a semicolon and some unrelated # statement with commas in it. if ';' in text: @@ -2094,7 +2094,7 @@ @param tokens list of tokens as generated by tokenize.generate_tokens @return logical line (string) """ - # from pep8.py with minor modifications + # from pycodestyle.py with minor modifications logical = [] previous = None for t in tokens: @@ -2121,16 +2121,16 @@ def pep8Expected(self): """ - Public method to replicate logic in pep8.py, to know what level to - indent things to. + Public method to replicate logic in pycodestyle.py, to know what level + to indent things to. @return list of lists, where each list represents valid indent levels for the line in question, relative from the initial indent. However, the first entry is the indent level which was expected. """ # What follows is an adjusted version of - # pep8.py:continuation_line_indentation. All of the comments have been - # stripped and the 'yield' statements replaced with 'pass'. + # pycodestyle.py:continuation_line_indentation. All of the comments + # have been stripped and the 'yield' statements replaced with 'pass'. if not self.tokens: return @@ -2233,10 +2233,11 @@ valid_indents[row] = vi # Returning to original continuation_line_indentation() from - # pep8. + # pycodestyle. visual_indent = indent_chances.get(start[1]) last_indent = start - rel_indent[row] = pep8.expand_indent(line) - indent_level + rel_indent[row] = \ + pycodestyle.expand_indent(line) - indent_level hang = rel_indent[row] - rel_indent[open_row] if token_type == tokenize.OP and text in ']})':