Plugins/CheckerPlugins/Pep8/Pep8Checker.py

changeset 2896
9fa71ee50b3d
parent 2864
d973dab8b715
child 2917
fe82710d02cb
equal deleted inserted replaced
2895:4a44d92757f9 2896:9fa71ee50b3d
10 import os 10 import os
11 11
12 from PyQt4.QtCore import QProcess, QCoreApplication 12 from PyQt4.QtCore import QProcess, QCoreApplication
13 13
14 from . import pep8 14 from . import pep8
15 from .Pep8NamingChecker import Pep8NamingChecker
15 16
16 import Preferences 17 import Preferences
17 import Utilities 18 import Utilities
18 19
19 from eric5config import getConfig 20 from eric5config import getConfig
35 @keyparam select list of message IDs to check for 36 @keyparam select list of message IDs to check for
36 (comma separated string) 37 (comma separated string)
37 @keyparam ignore list of message IDs to ignore 38 @keyparam ignore list of message IDs to ignore
38 (comma separated string) 39 (comma separated string)
39 @keyparam max_line_length maximum allowed line length (integer) 40 @keyparam max_line_length maximum allowed line length (integer)
40 @keyparam hang_closing flag indicating to allow hanging closing brackets (boolean) 41 @keyparam hang_closing flag indicating to allow hanging closing
42 brackets (boolean)
41 """ 43 """
42 self.errors = [] 44 self.errors = []
43 self.counters = {} 45 self.counters = {}
44 46
45 interpreter = Preferences.getDebugger("PythonInterpreter") 47 interpreter = Preferences.getDebugger("PythonInterpreter")
100 while argindex < arglen: 102 while argindex < arglen:
101 args.append(output[index + 6 + argindex]) 103 args.append(output[index + 6 + argindex])
102 argindex += 1 104 argindex += 1
103 index += 6 + arglen 105 index += 6 + arglen
104 106
105 text = pep8.getMessage(code, *args) 107 if code in Pep8NamingChecker.Codes:
108 text = Pep8NamingChecker.getMessage(code, *args)
109 else:
110 text = pep8.getMessage(code, *args)
106 self.errors.append((fname, lineno, position, text)) 111 self.errors.append((fname, lineno, position, text))
107 while index < len(output): 112 while index < len(output):
108 code, countStr = output[index].split(None, 1) 113 code, countStr = output[index].split(None, 1)
109 self.counters[code] = int(countStr) 114 self.counters[code] = int(countStr)
110 index += 1 115 index += 1

eric ide

mercurial